Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Detecting Null
Wed, Feb 13 2013 10:41 AMPermanent Link

Matthew Jones

var
 MyValue : String;
begin  
 MyValue := Window.SessionStorage.GetItem('my_value');

// How can I check if MyValue is null or not?

Right now I read a value and check if it is '1', and if it isn't then I assume my
settings are not initialised, but I'd rather have a better test.

/Matthew Jones/
Thu, Feb 14 2013 12:42 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< // How can I check if MyValue is null or not? >>

Just use this:

if (MyValue=nil) then
  ShowMessage('Value is null');

In EWB, strings, like arrays, can be nil if they haven't been assigned or
their length assigned via SetLength().

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Image