Forum Discussion

Neihls_298286's avatar
Neihls_298286
Icon for Nimbostratus rankNimbostratus
Oct 18, 2017

iRule expr arithmetic broken

This arithmetic expression isn't working for me:

 

set $sum [expr {$integer + 14}]

 

In debug logs, $integer is 31.

 

The irule just stops processing.

 

At one time, I got this tmm error, but not ever again:

 

invalid command name "expr{31" while executing "expr{$integer + 2}"

 

1 Reply

  • Never mind.

     

    It didn't work when the expression assigns the sum to the same variable as one of the operands.

     

    E.g. This doesn't work:

     

    set integer [expr{$integer + 14}]

     

    And this does work:

     

    set sum [expr{$integer + 14}]