&& during debugging (QuickWatch), unexpected behaviour 
Author Message
 && during debugging (QuickWatch), unexpected behaviour

While debugging a problem with an if statement that didnt call the if block
every time it should have, I stumbled across the following:

 [example code]
private void Form1_Load(object sender, System.EventArgs e) {
TestClass testClass = new TestClass();
if ((testClass != null)&&(testClass.TestString != null))
{ MessageBox.Show(testClass.TestString); }


public class TestClass {
public string TestString;
public TestClass()
{ TestString = "Test"; }


if there is a breackpoint set on the if statement, a QuickWatch on the
condition yields 'unable to evaluate expression'.
Autos shows the object and string correctly.
The same message shows up when only evaluating the left or the right part of
the expression.
Stepping on shows the messagebox. What's going on here?
 I think understanding this behaviour could help me in understanding C#   :/

Thanks for illuminating me


Tue, 23 Nov 2004 15:54:59 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Unexpected COM & DLL unload

2. ***&&&>>> HELP --- CXL --- HELP <<<&&&****

3. Linker error 2001 @&(#&@#&$@

4. Linker error 2001 @&(#&@#&$@

5. scanf & EOF behaviour

6. Unexpected behaviour with EOF

7. Unexpected behaviour from Seek - Please help.

8. Unexpected behaviour of ISharedProperty::get_Value(VARIANT* pVal) method

9. Unexpected behaviour from gcc version egcs-2.91.66

10. Extract document name during Drag & Drop operation

11. Auto-scroll in a CTreeCtrl during a drag&drop operation

12. Unexpected behaviour of StretchBlt in VS6.0


Powered by phpBB® Forum Software