Page 1 of 1

Multi Menu Scripting

Posted: 06 Oct 2013 00:20
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.

Re: Multi Menu Scripting

Posted: 06 Oct 2013 22:39
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.