I have a script attached for a test example of a problem I'm having... it's where I'm using an alias to generate a speed menu. If I right click on the alias in the settings editor and select EXECUTE then the speed menu is created correctly. However, if I run the alias from the command line (or it's fired by a trigger) then the value of the menu item is wrong. It comes down to the expansion of %%i in a nested forall loop. If executed from the settings editor it expands as expected, but from the command line it expands to just %i. I'm sure it's something I'm doing wrong.. but could someone tell me how to get around this problem?
Thanks in advance.
Eupher
#CLASS {testing}
#ALIAS generate_test_menu {
#DELCLASS testing|testing_menu
#CLASS {testing|testing_menu} {menu}
#FORALL @recipe_names {
#MENU {%i} {} "" {%{i}_menu}
#CLASS {testing|testing_menu|%{i}_menu} {menu}
#MENU {Edit} {
#VARIABLE ingredients_pick_list "" {} {testing}
#FORALL @ingredients {#IF (%ismember( %%i, %db( @recipes, %i))) {#ADDITEM ingredients_pick_list %concat( "*", %%i)} {#ADDITEM ingredients_pick_list {%%i}}}
#ADDKEY ingredients_pick_list {%i} %pick( "p:Select the ingredients to make %i", {@ingredients_pick_list})
generate_test_menu
} ""
#MENU {Delete} {#YESNO "Delete the %i recipe?" {
#DELKEY recipes {%i}
generate_test_menu
}}
#CLASS {testing|testing_menu} {menu}
}
#CLASS 0
}
#VARIABLE recipes {meatloafchocolate cakepasta salad}
#VARIABLE ingredients {meat|onion|noodles|tomatoes|mayo|flour|egg|milk|oil}
#VARIABLE recipe_names {meatloaf|chocolate cake|pasta salad}
#VARIABLE ingredients_pick_list {meat|onion|noodles|tomatoes|mayo|flour|egg|milk|oilmeatloaf} {}
#MENU {Testing Menu} {} "" {testing_menu}
#CLASS 0