variable

How to test if a variable exists or not

Ever since leaving PHP coding for QlikView - I've always missed the Handy isset function to check if a variable, well, isset. But its actually possible to use the isnull function to do the same in the script. Just remember not to use $ sign expansion! Since this will evaluate the variable, before its passed into the function.

This works nicely:

If isnull(foo) Then
    Let foo = 'bar';
    trace now it exists;
Else
    trace exists;    
End if
Syndicate content