OWBasic for Pocketviewer

Home INTRO Group CONTROL Alphabetical Index

Muliple Alternatives

CASE SELECT <Value>
CASE <Value1>: <Instructions1>
CASE <compasism-operator><Value2>: <Instructions2>
CASE <Value3> TO <Value4>: <Instructions3>
CASE ELSE: <DefaultInstructions>
ENDCASE

Multiple alternatives of instructions. If Value given with CASE SELECT matches the value of an CASE part, the corresponding instructions are executed. Only one, the first, CASE part is executed, even if more the one parts would match. The CASE ELSE part is executed, if no other part matches. The CASE ELSE part, if existent, must be the last CASE part. Value, Value1 .. can be expressions too and must have the type integer, char or boolean.

Example:

CASE SELECT a 
CASE <1:     PRINT "below 1"
CASE 1:      PRINT "one"
CASE =2:     PRINT "two"
CASE 3:      PRINT "three"
CASE 4 TO 6: PRINT "four, five or six"
CASE >=7:    PRINT "above or equal to seven"
ENDCASE


  • IF - Conditional Execution of Instructions
Home INTRO Group CONTROL Alphabetical Index