Does it produce that error regardless of whether myString actually is null?
If not, you have your answer. BTW string being empty, i.e., "", is different
from null.

Signature
Jim
"Remember, an amateur built the Ark; professionals built the Titanic."
> In VS .NET (2002), how can you check whether an object is null in the
> debugger (Watch window)?
[quoted text clipped - 11 lines]
> Thanks,
> Casey
Casey - 29 Oct 2003 23:56 GMT
I want to set a breakpoint that conditionally breaks if an object is null.
However, I have not been able to find any syntax that allows me to do this.
When I try to compare the object to null, VS .NET says it is invalid syntax.
> Does it produce that error regardless of whether myString actually is null?
> If not, you have your answer. BTW string being empty, i.e., "", is different
[quoted text clipped - 19 lines]
> > Thanks,
> > Casey
Nick Savoiu - 30 Oct 2003 02:09 GMT
Did you try comparing with 0?
Nick
> I want to set a breakpoint that conditionally breaks if an object is null.
> However, I have not been able to find any syntax that allows me to do this.
[quoted text clipped - 25 lines]
> > > Thanks,
> > > Casey
Casey - 05 Nov 2003 22:40 GMT
Yes, I did. It evaluates to false regardless of whether it is null or not.
> Did you try comparing with 0?
>
[quoted text clipped - 32 lines]
> > > > Thanks,
> > > > Casey
Nick Savoiu - 06 Nov 2003 00:12 GMT
that doesn't sound right... what was the condition that you were breaking
on?
nick
> Yes, I did. It evaluates to false regardless of whether it is null or not.
>
[quoted text clipped - 36 lines]
> > > > > Thanks,
> > > > > Casey
Casey - 07 Nov 2003 23:08 GMT
I have code like this...
object o = null;
int i = 3; // set a breakpoint here
int j = 5; // want to set a conditional breakpoint here; only want to break
here if o is null
In the visual studio .NET watch window, type the expression "o == 0". It
evaluates to false even though o is null. If I just watch the object o, the
watch window says it is null. However, I can't find an expression that will
allow me to compare an object vs null, therefore I can't conditionally break
if the object is null.
> that doesn't sound right... what was the condition that you were breaking
> on?
[quoted text clipped - 44 lines]
> > > > > > Thanks,
> > > > > > Casey