Difference between revisions of "Switch"

From FreeSpace Wiki
Jump to: navigation, search
(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...")
 
(No difference)

Latest revision as of 21:57, 7 March 2021

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.