Code Sample |
mainmenu submenu1 command-a command-b submenu2 command-c command-d end end submenu3 command-e command-f end end |
Code Sample |
define_mainmenu submenu1 submenu3 end define_submenu1 command-a command-b submenu2 end define_submenu2 command-c command-d end define_submenu3 command-e command-f end |
Code Sample |
set X=1 set menu[30] = string <= an array of strings setup the main menu[1] <= maybe a function, adds header stuff to string Loop while there are still lines to read & X>0 if the line is an executable then cons a string for the entry to the end of menu[X] if the line is the start of a submenu then cons a string for the submenu to the end of menu[X] set X=X+1 add header stuff for the new menu to the new string (now X+1) if the line is an end add end menu stuff to the current menu X=X-1 Loop End for each X, print menu[X] |
Code Sample |
[submenu] (submenu1) [exec] (something) {some command} [submenu] (submenu 2) [exec] (something) {some command} [exec] (something) {some command} [end] [exec] (something) {some command} [exec] (something) {some command} [end] |