Forum Discussion
Jul 05, 2014
correct syntax for boolean expressions
I experiencing errors with forming a simple boolean expression that would be valid in most "C like" languages ( if we added an equals sign = 😞
set var1 $var2 && !$var3
error: [wrong args][set ...
Kevin_Stewart
Jul 05, 2014Employee
My hunch here would be that only one expr is needed. Also, and I missed this earlier, it's more semantically correct to enclose the expressions in curly braces:
if { [expr {$v1 && $v2}] } { do something }
For a more detailed explanation of the expr syntax, I'd consult the tcl mothership:
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