switch()
btmux-0.6-rc4/game/text/help/cat_mux/cat_functions/switch() · 685 B
From the archive btonline-btechmux-0.6-rc4.tbz2
Download the archive « Back to the archive contents
& switch() Syntax: switch(<str>[,<pat1>,<res1>]...[,<dflt>]) The switch function compares <str> against <pat1>, <pat2>, etc (allowing * to match any number of characters and ? to match any 1 character), and returns the corresponding <resN> parameter for the first <patN> pattern that matches. If none match, then the default result <dflt> is returned. Example: > say switch(c,*a*,A,*b*,B,*c*,C,*d*,D,E) You say "C" > say switch(f,*a*,A,*b*,B,*c*,C,*d*,D,E) You say "E" > say switch(cab,*a*,A,*b*,B,*c*,C,*d*,D,E) You say "A" > say switch(f,*a*,A,*b*,B,*c*,C,*d*,D) You say "" See Also: @switch, match(), ifelse(), case()