|
Post by Kelly Ethridge on Feb 17, 2005 15:19:38 GMT -5
Hello,
Several classes have methods that return a string value. StreamReader.ReadLine comes to mind. If there is nothing left to read from the stream, then Null is currently returned. This requires as Variant to be used if you plan on dealing with the Null. I am wondering if it would be more preferable to have a null string returned, as opposed to an empty string which can still be a valid return. Basically, the string pointer would need to be checked, or the cString.IsNull function used. That way, a string datatype can still be used, and the null can still be handled. Or should I just leave those and future methods with the Null return?
Kelly
|
|
|
Post by harmar on Feb 18, 2005 13:30:38 GMT -5
i would prefer vbNullString when dealing with strings, since variants aren't supported in .NET anymore and this would make it easier when you want to 'upgrade' your program. also i only use variants when there's no other way, i.e. when Nulls could happen.
harmar
|
|
|
Post by Kelly Ethridge on Mar 4, 2005 17:24:13 GMT -5
Ok, I agree. I have changed the use of Variants with Null to Strings with vbNullString. Now code will need to used cString.IsNull for those functions that distinguish between an empty string and a null string.
Kelly
|
|