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

[REBOL] is there a better way?

From: rishioswal:yah:oo at: 5-May-2001 13:06

wondering if there is a better way to do the following lines of code (rather than using so many if statements) menu-choice: choice 150 "Menu1" "Menu2" "Menu3" [ if ((first value) = "Menu1") [menu-panel/pane: menu1 show menu-panel] if ((first value) = "Menu2") [menu-panel/pane: menu2 show menu-panel] if ((first value) = "Menu3") [menu-panel/pane: menu3 show menu-panel] ] i tried this... menu-choice 150 "Menu1" "Menu2" "Menu3" [ [menu-panel/pane: to-word first value show menu-panel] ] i also tried variations of this menu-choice 150 "Menu1" "Menu2" "Menu3" [ [set 'menu-panel/pane to-lit-word first value show menu-panel] ] but nothing elegant seems to work... rishi