if (node != null)
{
// do something
}
It is the job of the developer to use a null value as meaning "undefined" or unitialized. There is no true "undefined" equivalent
in C#.
If you declare a reference type:
private string mystring;
It will be initialized as "null" within the scope of a class.
If you have a method:
private void MyMethod(string Variable)
{
}
A caller may pass a null value in as "Variable".
If you do not wish to accept null values I might suggest that you then throw an exception, depending on the context of the method:
throw new ArgumentNullException("Variable");
-- Hope this helps.
--
Dave Sexton
ds*************@somethingdigitalBYE-SPAM.com (remove BYE-SPAM)
[Please do not reply by email unless asked to]
-----------------------------------------------------------------------
"Bob" <an*******@discussions.microsoft.com> wrote in message news:21****************************@phx.gbl...
IN JScript, we can use the keyword undefined as follows:
if (node!=undefined)
{
//do something
}
What is the equivalent of the above in C#?
Thanks,
Bob