Forum Discussion
MACTEP
Altocumulus
Feb 25, 2013Check if static variable exists before referencing to it
Hi All,
I have created an iRule performing DNS lookup and storing the result in static variable, so it could be referred from another iRule.
....
set static::my_variable "some v...
MACTEP
Altocumulus
Feb 26, 2013Confirmed, works as expected whenever variable is defined, not defined, has empty or non-empty value.
if {[info exists "static::my_variable"]}{
log local0.err "Variable my_variable is defined"
if {"${static::my_variable}X" eq "X"}{
log local0.err "variable value is empty"
} else {
log local0.err "variable value is ${static::my_variable}"
}
} else {
log local0.err "Variable static::my_variable is NOT defined"
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
