Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 CMM2

CHOICE(condition, ExpressionIfTrue, ExpressionIfFalse)


This function allows you to do simple either/or selections more efficiently and faster than using IF THEN ELSE ENDIF clauses
The condition is anything that will resolve to nonzero (true) or zero (false)
The expressions are anything that you could normally assign to a variable or use in a command and can be integers, floats or strings
print choice(1, "hello","bye") will print "Hello"
print choice(0, "hello","bye") will print "Bye"
a=1:b=1:print choice(a=b, 4,5) will print 4

 ' new method
   INPUT x
   answer$ = CHOICE(x>5,"High","Low")
   PRINT answer$
 ' old method
   INPUT x
   IF x > 5 THEN
     answer$ = "High"
     answer$ = "Low"
   PRINT answer$

Last edited: 15 December, 2020