Skip to content
Luxembourg edited this page Mar 20, 2013 · 4 revisions

@switch

command: @switch[/<switches>] <string>=<t1>,<c1> [,<tn>,<cn>]... [,<cd>]

compares <string> against the targets <t1>, <t2>, etc, until a match is found, at which time the corresponding list of commands is performed.

#$ is substituted with the value of <string>. in this way, the commands in <c1>..<cn>..<cd> have a short-hand way of getting at the matched value.

wildcards match strings, and the < and > operators allowing matching by numeric value. by default, any list whose target matches the string is executed (the targets are not mutually exclusive). if no target matches, the default list <cd> is executed.

the following switches are available:

/all - (default) perform the action lists associated with all targets that match <string>. /first - perform only the action list associated with the first target that matches <string>. /notify - queues an '@notify' after all commands in the list.

related topics: switch(), ifelse().

Clone this wiki locally