Name

if

if expr1 [then] body1 [elseif expr2 [then] body2...] [else] [bodyN]

Execute a conditional expression. If boolean expression expr1 is true, evaluate body1. Otherwise, test optional additional expressions and execute the matching body. The optional else keyword is followed by a command body that is executed if no previous conditional expressions were true. The keywords then and else are optional.

Example

if {$x < 0} {
       set y 1
    } elseif {$x == 0} {
       set y 2
    } else {
       set y 3
    }
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset