If ... else


if expression


Can be single line:

if(expression) statements
[else statements]



if(expression) statements [else statements]



expression - any expression.



If expression is true (not 0), executes statements after if and skips statements after else (if used). Else skips statements after if and executes statements after else (if used).


else if does not require double indentation of following lines. See example.


See also: Operators, ifa, ifk, iif sel



if i=10
	out "i is 10"

if i=10
	out "i is 10"
	out "i is not 10"

if i > 0
	out "i is greater than 0"
	if(s.endi(".exe")) ret i; else ret 0
else if i < 0
	out "i is less than 0"
	out "i is 0"

if a and b
	out "a is not 0, and b is not 0"
	if c or d or e
		out "c is not 0, or d is not 0, or e is not 0"