switch statement - case doesn't accept sequence elements?
- Posted by evanmars Dec 01, 2014
- 1212 views
Is this a bug? Cannot use a sequence element for the 'case' comparison.
constant numbers = {34553, 235452} procedure CheckNum(atom number) switch number do case numbers[1] then puts(1,"Base location\n") case numbers[2] then puts(1,"Second location\n") end switch end procedure CheckNum(34553)
crashes with:
this, of course, works:
sequence numbers = {34553, 235452} procedure CheckNum(atom number) switch number do case 34553 then puts(1,"Base location\n") case 235452 then puts(1,"Second location\n") end switch end procedure CheckNum(34553)