Re: New switch/case idea

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu