TU-Berlin → Inst. f. Mathematik → Algebra und Zahlentheorie → KASH → Documentation → Reference Manual
KASH3 Reference Manual




if <elt-alg^boo> then <statements1> ; { elif <elt-alg^boo> then <statements2> } [ else <statements3> ] fi;


The 'if' statement allows one to execute statements depending on the value of some boolean expression. The execution is done as follows: First the boolean expression following the 'if' is evaluated. If it evaluates to 'true' the statement sequence <statements1> after the first 'then' is executed, and the execution of the 'if' statement is complete. Otherwise the boolean expressions following 'elif' are evaluated in turn. There may be any number of 'elif' parts, possibly none at all. If the 'if' expression and all, if any, 'elif' expressions evaluate to 'false' and there is an 'else' part, which is optional, its statement sequence <statements3> is executed and the execution of the 'if' statement is complete. If there is no 'else' part, the 'if' statement is complete without executing any statement sequence. Since the 'if' statement is terminated by the 'fi' keyword there is no question where an 'else' part belongs.

Built: Mon Nov 14 21:12:39 UTC 2005 on mack
The KANT Group