Also known as: TRIGEDIT-SWITCH · CASE · TRIG-CASE · DEFAULT · BREAK · %SWITCH%
Usage:
switch %random.3%
case 1
%echo% This case has a 33% (1 in 3) chance of firing.
break
case 2
%echo% This case has a 33% (1 in 3) chance of firing.
break
default
%echo% default case covers any unmatched cases. In this case 3
@%echo% so it also has a 33% (1 in 3) chance of firing.
break
done
Switch evaluates an expression and looks for a match amongst the case
statements that follow. If none of the following case statements are a match,
and a default statement exists, the default statement is considered a match.
If a match is found, the commands that follow it, up until a break or done
command, are executed.
Break is used to terminate commands in a switch or to stop a loop HELP WHILE.
Case is used to begin a new conditional group in a switch block.
Default is similar to case but matches any condition not met.
Done is used to terminate a while or switch block.
Example: TSTAT 35, 18, 6, 153, 132