Re: New Switch Idea
- Posted by jeremy (admin) Mar 27, 2009
- 1166 views
bernie said...
How about allowing an integer or a sequence between the case keyword and the colon ?
Bernie,
Currently sequences are allowed, but finding of one item in a sequence does not work. We are looking to expand switch/case in 4.1 for some of these options. Here are two examples:
switch "apple" do case "pear": ? 1 case "banana": ? 2 case "apple": ? 3 case "orange": ? 4 end switch -- Output: 3 switch 1 do case {1,2,3}: ? 1 case {4,5,6}: ? 2 case else ? -1 end switch -- Output: -1
Jeremy