wrong value for a variable showing in the watch window 
Author Message
 wrong value for a variable showing in the watch window

In the code below variable <str.Length> in the Watch
windows shows value 2 and variable <i> shows 100. But

Console.WriteLine( "Length: {0}", str.Length );

Outputs 100

The code:

using System;
using System.IO;

namespace ConsoleApplication9
{
        /// <summary>
        /// Summary description for Class1.
        /// </summary>
        class Class1
        {
                [STAThread]
                static void Main(string[] args)
                {
            char[] buffer = new Char[100];

            buffer[0] = 'a';
            buffer[1] = 'b';
            buffer[3] = '\0';

            string str = new string(buffer);

            int i = str.Length;

            if ( i != str.Length )
                Console.WriteLine( "ta-da" );
            Console.WriteLine( "Length: {0}", str.Length );
                }
        }

Quote:
}



Tue, 03 Aug 2004 22:54:53 GMT  
 wrong value for a variable showing in the watch window
HI Nicholas,

    It looks like an issue with the watch window. The value for str.Length
should display as 100. I have sent email about this and will let you know
what I find. Please let me know if you have any questions.

Regards,

- Erik

This posting is provided "AS IS" with no warranties, and confers no rights.



Wed, 04 Aug 2004 01:24:32 GMT  
 wrong value for a variable showing in the watch window
Hi Nicholas,

   I heard back from the development team about this issue. I was told it
was an issue with the de{*filter*} and would be fixed in the next release. I
hope that helps. Let me know if you have any questions about this.

Regards,

- Erik

This posting is provided "AS IS" with no warranties, and confers no rights.



Wed, 04 Aug 2004 03:11:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Variable Window Wrong Values For Variables

2. wrong value in Watch Window

3. Variable data not showing in watch windows

4. Variables in Variables / Watch window

5. Watch window, what is wrong with you?

6. How to use the Watch Window to debug class (last message had wrong email)

7. COM properties don't show in VB watch window

8. Help: damn vectors won't show up in watch window

9. Watch Window's Value

10. incorrect value of expression in debug Watch window

11. Watch Window value.

12. Formatting object values in the watch window

 

 
Powered by phpBB® Forum Software