Re: New switch/case idea
- Posted by znorq2 Apr 02, 2009
- 1939 views
Sorry if this has been mentioned before, but I would really like to see 'in' and 'to' keywords used in the switch statement;
a) in
Using 'in' (there might be a better choice, this is the one I used) with a sequence;
myChoices = {1,2,5,"test",-5000} myAlpha = "abcdef" switch myVar [with | without falltru] do case in myChoices then [...statements...] case in myAlpha then [...statements...] case else [...statements...] end switch
b) to
Using 'to';
switch myVar [with | without falltru] do case 1 to 50 then [...statements...] case 50 to 100 then [...statements...] case else [...statements...] end switch
Kenneth / ZNorQ