Forum Discussion

BaltoStar_12467's avatar
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 var1 $var2 && !$var3]

set var1 ($var2 && !$var3)

error: [wrong  args][set var1 ($var2 && !$var3)]

13 Replies

  • null nil undefined do not exist in tcl

    However I am receiving error when applying string operator

    ne
    to param and cookie values :

    set param1 [URI::query [HTTP::uri] param1]
    set cookie1 [HTTP::cookie value "cookie1"]
    
    if { [expr { [expr { $param1 ne "" }] || [expr { $cookie1 ne "" }] } ] }
    

    TCL error: /Common/myirule.conf  - syntax error in expression " ne ": unexpected operator ne     while executing "expr $param1 ne """