Pick from several named cases
THE BASIC LANGUAGE
SELECT CASE is handy when one value determines which of several lines to use. Here, both local platforms share one reply.
FUNCTION Run()
DIM track = 2
SELECT CASE track
CASE 1, 2
RETURN "Local train"
CASE 3
RETURN "Express"
CASE ELSE
RETURN "No departure"
END SELECT
END FUNCTIONBASIC evaluates track once. A comma in CASE 1, 2 means either value matches. CASE ELSE catches any value the earlier choices missed.
What you should see With track set to 2, the result is Local train. A 3 returns Express. A 9 returns No departure.
Use IF and ELSEIF for ranges such as “fewer than five coins.” The PCA3D dialect accepts equality choices in CASE. A classic BASIC CASE range or CASE IS expression needs to be rewritten here.
