Forum Discussion
Rob_Dobrzycki_3
Nimbostratus
Jun 11, 2018simple if statement issue
Hi, I am trying to use simple comparison:
set nullindex 1
if{($nullindex>-1)}{ log local1. "test" }
This what I see in a log: invalid command name "if{(1>-1)}{" while executing "if{($nullindex>-1)}{"
Please, help
- JG
Cumulonimbus
set nullindex 1 if { $nullindex > -1 } { log local1. "test" }
or if you insist on using parenthesis:
set nullindex 1 if { ($nullindex > -1) } { log local1. "test" }
- Stanislas_Piro2
Cumulonimbus
The issue is it tries to evaluate command
instead ofif{(1>-1)}{
because there is no space afterif
if
And there is also a missing space after the closing curly bracket!
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