String Initialized to odd characters

  • Thread starter Thread starter Elizabeth Graham
  • Start date Start date
E

Elizabeth Graham

I am creating a global string variable in the beginning of my code. I
am setting the string to an empty value. I am running the component
in debug mode and when I step through the component, the string is
initialized to odd characters and I cannot change the value.

The following is the code I have to create the variable:

private string strDirectory="";

When I step through the code the string has the following value:

strDirectory "酌ힸ³" string

When executing the following code, the value of the string does not
change:

strDirectory = fileinfo.DirectoryName;

Thanks in advance for any help.
 
Elizabeth Graham said:
I am creating a global string variable in the beginning of my code. I
am setting the string to an empty value. I am running the component
in debug mode and when I step through the component, the string is
initialized to odd characters and I cannot change the value.

The following is the code I have to create the variable:

private string strDirectory="";

When I step through the code the string has the following value:

strDirectory "酌ힸ³" string

When executing the following code, the value of the string does not
change:

strDirectory = fileinfo.DirectoryName;

That sounds like your debugger is toasted. What happens if you write
the value to something else from within your code? Do you have a short
but complete example which demonstrates the problem when you're
debugging?
 
Hi Elizabeth,
That is really strange.
Can you provide some code how you create that variable. What do you mean by
global variable?
C# doesn't support global variable declaration.

B\rgds
100
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top