Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] How can one use named constants in switch?

From: dlhawley::home::com at: 24-Oct-2001 21:33

I just spent a while trying to figure out why the following fails: case_a: 1 case_b: 2 msgType: getMsg ... ; integer! switch msgType [ case_a [ msgA ] ... ] this fails since the cases are variables not constants (from a C perspective where case_X would be an enum or #define). Is there any way to write this except switch msgType [ 1 [ msgA ] ... ] ? Thanks, Dave -- David L. Hawley D.L. Hawley and Associates 1.503.274.2242 Software Engineer [David--L--Hawley--computer--org]