R
rno
Hi,
Pls bear with me as I am very new to C#. Would appreciate some insite
on this:
I have a string[][] A
I have a method that goes something like this
string[][] bla()
string[][] x = null;
{
try
{
...some code..
}
catch
{
...a COM exception..
}
return x;
}
The idea being that I can check for null if an exception occurred,
the exception itself is expected and I want to ignore it. (this is all
in some loop)
When I do A = bla();
and check for A with if (A != null), the code following will still
run, even if (or so the debugger tells me), A is null.
When I hover over the A in A != null , VS tells me A is null, and when
I hover over the != part it tells me that null != null equals false.
Eh, that makes sense too? What am I missing? How do I check for 'A is
not null'?
Clearly, I must be missing something fundamental here, but what?
tia
arno
Pls bear with me as I am very new to C#. Would appreciate some insite
on this:
I have a string[][] A
I have a method that goes something like this
string[][] bla()
string[][] x = null;
{
try
{
...some code..
}
catch
{
...a COM exception..
}
return x;
}
The idea being that I can check for null if an exception occurred,
the exception itself is expected and I want to ignore it. (this is all
in some loop)
When I do A = bla();
and check for A with if (A != null), the code following will still
run, even if (or so the debugger tells me), A is null.
When I hover over the A in A != null , VS tells me A is null, and when
I hover over the != part it tells me that null != null equals false.
Eh, that makes sense too? What am I missing? How do I check for 'A is
not null'?
Clearly, I must be missing something fundamental here, but what?
tia
arno