if - Condition for the program
if expression then statements elseif expression then statements … else statements *endif
This statement is used to control what part of a program is executed. One can use an "if" condition at the beginning of a loop. The function adds a condition for the program. It will execute this part of the program if the condition is respected.
if expression is a string with value true, then if is true.
if expression is a string with value false, then if is false.
if expression is a string and the number of the string is not 0 than its true else its false. If any characters under than a number is in the string, it will not be ccompared to a number.
See also Switch
if x == 1 then "x=1\n"; elseif x == 2 then "x=2\n"; else "x=?\n"; endif if x == 1 then "x=1\n"; elseif x == 2 then "x=2\n"; else "x=?\n"; endif
Written by Pierre Laplante and Caroline Laplante, <firstname.lastname@example.org>
1.0 2014-09-09 21:24:14 email@example.comEdit
© 2021 extenso Inc. All rights reserved.