Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
I am checking the null value in variable Filter like this.
Let Filter=trim(peek('Filter',$(i),'TableNames'));
IF not IsNull($(Filter)) THEN
//code
ELSE
//code
ENDIF
I want to check if Filter gets null then code after ELSE should go
and if Filter gets some string the code after IF should go??
is it correct??
when i get string value in filter varialbe it shows errror
thanks
Lavi
The code seems to be correct.
Which error do you get ?
may be in place of let you need to write set
because if you create varible using set then it is calculated uing $ sign expression
and let will calculate directly
other wise code looks good
hope this helps
@sunil,
Can u see i have used Peek function which doesn't work when i use set
thanks
This is the error i am getting
Script line error:
IF not IsNull(De Kil Kraanbedrijf) THEN
see when the string value comes in the Filter variable it gives error. But when null comes in it is okay.
thanks
but it iwll get calculated when you use
$(Filter)
please try once and then let me know
Let Filter=trim(peek('Filter',$(i),'TableNames'));
IF not IsNull($(Filter)) THEN
//code
ELSE
//code
ENDIF
you need to define $(i) also
Lavi
I think the problem is the $ expansion of Filter inside the IsNull() function. This cause the 'evaluated' value of Filter to be passed to IsNull, which is probably invalid and therefore causing your error.
Instead of IsNull($(Filter)), use
Let Filter = ....
If Not(IsNull(Filter)) Then
Else
End If
Regards
Jonathan
Hi,
You may need to add single qoute around the '$(Filter)' variable when you check not isnull since you are using LET variable.
When you use the LET varibale, your expression is already calculated and your variable will have the resultant value. If you again equate the 'Filter' variable with variable expansion $(Filter) when your variable is holding null value then you`ll get script line error.
Have a look at the attached application.
Let Filter=trim(peek('Filter',$(i),'TableNames'));
IF not IsNull($(Filter)) THEN
//code
ELSE
//code
ENDIF
Hope this helps you.
-Sridhar