|Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread|
|Messages 1 to 2 of 2 total|
|Detecting a null string|
|Mon, Dec 12 2016 10:49 AM||Permanent Link|
Way back in 2013, in EWB v1, you could detect a null value for a string with a compare against nil.
This no longer works. When I use GetProperty on a field that doesn't exist, the result value is null in this case.
I put in an "if assigned(mystring) then" to use another method, but this then doesn't discriminate between null and an empty string.
How can I know it is null?
(If anyone else has this, the particular workaround is to use PropertyType() to check it exists, but the general question still exists given that external interfaces could return null...)
|Wed, Dec 14 2016 3:06 PM||Permanent Link|
Tim Young [Elevate Software]
Elevate Software, Inc.
<< This no longer works. When I use GetProperty on a field that doesn't exist, >>
Don't do that. GetProperty is only intended to be used in cases where the property actually exists, thus avoiding any "undefined" issues, etc. It's isn't intended to be a full-on replacement for hash key-value access to the underlying JS object properties.