1. +++ Scripting: Now Multi-Scripts support nesting. The level is simply stated by the number denoting its depth, first level is 0 (zero)
Working great! And very fast to implement.
2. One note though, about a slight glitch: looks like an extra separator is added at the end of menus for each "_hidden" entry, e.g.
Code: Select all
"Top"
"Sub|||1"
sub "_routine";
"_routine"
msg 1;
3.
admin wrote:I would not pack any long code into the menu generating command. Just return values. Then process acc. to returned values.(Note to myself: Need to add switch() statement to scripting...)
Interesting and much more readable approach indeed (provided one doesn’t need dynamic menus, but that’s where the new "|||#" comes into play).
To whom it might interest, here’s a streamlined quick proof-of-concept, even without case/switch:
Code: Select all
// ---------------------------------------------> Menu structure
"_Initialize"
$menu = <<<MENU
Top1;;:paper;1
Sub1
Sub2
SubSub1;;*.ini
SubSub2
SubSub3;;;2
Top2;;<xy>
MENU;
sub popupnested($menu);
end 1;
// ---------------------------------------------<
// ---------------------------------------------> Menu content
"Sub1"
msg self("label");
"SubSub1"
msg self("label");
// SubSub2, SubSub3…
"Top2"
msg self("label");
// ---------------------------------------------<
Note: If necessary, it also works well with hidden entries ("_Sub1", "_SubSub1"…), loaded with:
sub "_".popupnested($menu);