Multi Menu Scripting

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47
Location: XY64 Latest Beta , Win 11, 96dpi, 100%

Multi Menu Scripting

Post by nerdweed »

I am trying to create a script that would be having lot of hidden subscripts. And a few more subscripts that would be generating the dynamic menus. I am able to generate these dynamic menus, however; am unsuccessful in calling the subscripts.

The current snippet appears this way
"MenuTLC"
$self=self(file) ;
$MENU="" ;
$MENU=$MENU."Filter Tagged |:tagsfind" <crlf> sub _FilterTagged <crlf> ;
$MENU=$MENU."Filter Labeled Items |:findlabel" <crlf> sub _FilterLabeled <crlf> ;
$MENU=$MENU."Searching $p_recursive" <crlf> load "$self","_SearchingWhere" <crlf> ;
load $MENU, , 's';

"MenuTag"
$MENU=$MENU."Filter Tagged |:tagsfind" <crlf> sub _FilterTagged <crlf> ;
load $MENU, , 's';

"_FilterTagged"
...
"_FilterLabeled"
...
"_SearchingWhere"
...
The sub part is not working as it tries to find the subscripts within the dynamic menu (I know its not exactly dynamic) where it doesn't exist. But the load also doesn't work. It discards the label part and loads the menu for the actual script showing
MenuTLC and MenuTag

I have tried heredoc as well but no joy. Any idea how to get this done.

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47
Location: XY64 Latest Beta , Win 11, 96dpi, 100%

Re: Multi Menu Scripting

Post by nerdweed »

Referred some scripts and have got it working.
"MenuTLC"
Global $MENU ;
Global $g_SStoreName = Self("base");
$MENU =<<<FOO
"Filter Tagged |:tagsfind"
Load "$g_SStoreName", "_FilterTagged" ;
"Searching $p_recursive"
Load "$g_SStoreName", "_SearchingWhere" ;
FOO;
load $MENU,* , 's';
This does work well.

Post Reply