This is an old revision of the document!
begin case
case boolean_expr
statement(s)
case boolean_expr
statement(s)
else
statement(s)
end case
The case structure allows the programmer to create a structure to test multiple conditions. Only the first true condition is executed and all of the other conditions are skipped. If there is an optional else as the last condition this will be executed if no other conditions are met.
for t = 1 to 10 begin case case t < 3 print t + " is less than 3" case t < 7 print t + " is less than 7 but 3 or larger" else print t + " is 7 or larger" end case next t
displays:
1 is less than 3 2 is less than 3 3 is less than 7 but 3 or larger 4 is less than 7 but 3 or larger 5 is less than 7 but 3 or larger 6 is less than 7 but 3 or larger 7 is 7 or larger 8 is 7 or larger 9 is 7 or larger 10 is 7 or larger
1.0.0.9 | New To Version |