M
mp
say i want to get an object from another objects method return
List<string> keylist = xlrdr.RangeValueList();
if keylist could be null...would i
if(keylist != null)
{
foreach (string str in keylist)
{ Debug.Print(str); }
}
else
{...handle null condition}
or should one just try
try
{ foreach (string str in keylist)
{ Debug.Print(str); }
}
catch
{...handle exception}
or should RangeValueList have raised an exception instead of returning null?
so the calling code doesn't have to mess with it
?
thanks
mark
List<string> keylist = xlrdr.RangeValueList();
if keylist could be null...would i
if(keylist != null)
{
foreach (string str in keylist)
{ Debug.Print(str); }
}
else
{...handle null condition}
or should one just try
try
{ foreach (string str in keylist)
{ Debug.Print(str); }
}
catch
{...handle exception}
or should RangeValueList have raised an exception instead of returning null?
so the calling code doesn't have to mess with it
?
thanks
mark