Switch

From FreeSpace Wiki
Revision as of 21:57, 7 March 2021 by TopAce (talk | contribs) (Created page with " Switch (Conditional operator) Performs one action according to the value of the first argument. If the argument evaluates to 0, the first action is performed; if the arg...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Switch (Conditional operator)
	Performs one action according to the value of the first argument.  If the argument evaluates to 0, the first action is performed; if the 
argument is 1, the next action is performed, etc.  If the value is out of range, no action is performed at all.

Takes 2 or more arguments...
	1:	Numeric expression to evaluate.
	Rest:	List of actions, one of which (at most) will be taken according to the value of the expression.