Hi Steven,
Debugger shows <undefined value> whenever reference variable is set to
*null*. For value types it won't show <undefined value>. In other words
*null* is <undefined value> for the debugger.
There is not Undefined.Value class and proerty if this is what you were
trying.
In the first example you posted you test *obj.myvar* in the second
*obj.var*. It might be the reason of the wrong result.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
"Steven Prasil" <pr****@nortel.com> wrote in message
news:cg*************@news.t-online.com...
I have a C# program with an if statement similar to
if (obj.myvar != Undefined.Value) { ...... }
When I test it in the CSharp CLR debugger this debugger does not recoginze
that the value is currently <undefined value> as shown in the watch list
of the Debugger. Hence the program branches into the if statement although it should skip
it obviously. Why?
Replacing the if statement above by
if (obj.var != null) { ......}
does NOT help. The programm jumps INTO the if branch.
Steven