Forum Discussion
Michael_Jenkins
Mar 07, 2015Cirrostratus
You'll need to use
[info exists myvariable]
(without the $
) to check for variable existence. Then you would do your other conditional check.
So like this in your example
when HTTP_REQUEST {
set myvariable 0
conditional processing ...
set myvariable 1
more processing ...
if {[info exists myvariable] && ($myvariable equals "1")} {
do something
}
}
If you know that your variable is going to be an integer, you could just use
$myvariable
instead of ($myvariable equals "1")
as it will return a true value for any positive value.