Re: Using "Load" to bring up a sub menu
Posted: 24 Jul 2015 06:56
When I try the script; this is what I see, no sub-menus ?
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
"exitnosave|:exitnosave"
copytext ":exitnosave"
"rfo|:rfo"
copytext ":rfo"
echo hi;
"mru|:mru"
copytext ":mru"
"myco|:myco"
copytext ":myco"
"***group 1***"
"flatview|:flatview"
copytext ":flatview"
"views|:views"
copytext ":views"
"minitree|:minitree"
copytext ":minitree"
"dp12|:dp12"
copytext ":dp12"
"_____most used______"
"newtab|:newtab"
copytext ":newtab"
"closetab|:closetab"
copytext ":closetab"
"locktab|:locktab"
copytext ":locktab"
"((( MIGHT HAVE USE )))"
"{drives_avl}|:{drives_avl}"
copytext ":{drives_avl}"
"{drives_fix}|:{drives_fix}"
copytext ":{drives_fix}"
"@@@ excluded @@@"
"ctb64|:ctb64"
copytext ":ctb64"
echo hi;
"%%% LAST SET %%%"I don't understand ?In the context of my script... (which you do used, per the screenshot you posted)
( http://www.xyplorer.com/xyfc/viewtopic. ... 15#p126336 )CookieMonster wrote:The script is halfway there
I did here; http://www.xyplorer.com/xyfc/viewtopic. ... 45#p126401 ?Please post the script you used in which you adapted what I wrote as a guidance, ie, XYscriptGroups_v2_uSERsETgROUPS_by_SF.xys with variable $a changed.
Put $a before you paste the code, then run as test script using script editor.SkyFrontier wrote:That code if execute differs from the posted screenshot.
Code: Select all
$a = <<<#
"exitnosave|:exitnosave"
copytext ":exitnosave"
"rfo|:rfo"
copytext ":rfo"
echo hi;
"mru|:mru"
copytext ":mru"
"myco|:myco"
copytext ":myco"
"***group 1***"
"flatview|:flatview"
copytext ":flatview"
"views|:views"
copytext ":views"
"minitree|:minitree"
copytext ":minitree"
"dp12|:dp12"
copytext ":dp12"
"_____most used______"
"newtab|:newtab"
copytext ":newtab"
"closetab|:closetab"
copytext ":closetab"
"locktab|:locktab"
copytext ":locktab"
"((( MIGHT HAVE USE )))"
"{drives_avl}|:{drives_avl}"
copytext ":{drives_avl}"
"{drives_fix}|:{drives_fix}"
copytext ":{drives_fix}"
"@@@ excluded @@@"
"ctb64|:ctb64"
copytext ":ctb64"
echo hi;
"%%% LAST SET %%%"
#;
$a = regexreplace($a, "^[ ](.*)(;\r\n)", " ; $1; <crlf>");
$a = regexreplace($a, "\r\n ", " ");
$a = trim($a, "<crlf>");
status "please wait...", "FF0000", "alert";
wait 1500;
status "doing: menu 1";
$Lmax0 = gettoken($a, count, "<crlf>");
$Lmax = $Lmax0 + 1; //lazy fix
$LreL = "";
$Lwdt = "4";
//labels ARE case sensitive
$Lsep = "|";
$LalphaU = "A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z";
$LalphaL = recase("$LalphaU", lower);
// $Lnumb = "1|2|3|4|5|6|7|8|9";
$Lcnt++;
while($Lcnt <= $Lmax) {
$Lnr = format("$Lcnt", "00000");
$Lcnt++;
if($Lcnt <= $Lmax) { }
else { break; }
$flg = 1;
$LtkC++;
$Ltk = gettoken($LalphaL, $LtkC, "|");
if($Ltk == "") { $LtkC = "1"; $Ltk = gettoken($LalphaL, $LtkC, "|"); }
else { }
$LreL = $LreL . "$Lnr" . "$Ltk" . "|"; //name goes here
}
$LreL = trim($LreL, "|");
$w = get("screen", "width");
$h = get("screen", "height");
$fct1 = $h \ 22;
$tt = gettoken($LreL, count, "|");
end ($tt != $Lmax0), "Oops. Total tokens of $" . 'a and $' . "LreL must match!";
$re = "";
$reX = "";
$reLB = "_ 00 0";
$reLX = "";
$op++;
$opF++;
$opM++;
while($op <= $tt) {
wait 50;
$tk = gettoken($a, $opF, "<crlf>");
$tkL = gettoken($LreL, $opF, "|");
if ($tk == "") {
beep;
//----------------------------------------may not be needed anymore...
$tkRE = gettoken(trim($re, <crlf>), count, <crlf>);
// $tkRE = $tkRE - 1; // lazy fix to get rid of extra label from user-name attributed caption
$reX = "$reX" . quote("$opM - " . quote("$tk", 1) . " - $tkRE item(s)") . " Load(" . quote('*') . "," . quote($reLB . $opM . ';-;' . $reLX) . ")" . "<crlf>" . "$re";
if($flg == "1") { }
elseif($flg != "1") { $flg = "3"; }
//$flg means "style", here: 1, normal; 2, check mark; 3, bold check mark
$reX = "$reX" . quote("$opM <- back |: 00 |$flg : _ 00 0" . "$opM") . " Load(" . quote('*') . ") ;";
break;
}
else { }
///////////////////////////////////////////////----------------------------------------------------------------------------------
$p1 = gettoken("$tk", "2", '"');
$p2 = gettoken("$tk", "3", '"', , "2");
if($p2 == "") { $p1 = ""; }
else { }
$b = quote("$p1 : _ $tkL") . "$p2" . ";";
$reLX = "$reLX" . "_" . " $tkL" . ";";
$re = $re . "$b" . "<crlf>";
$op++;
$opF++;
$tstCPTN = gettoken("$tk", "3", '"', , "2");
if($tstCPTN == "") {
$tkRE = gettoken(trim($re, <crlf>), count, <crlf>);
$tkRE = $tkRE - 1; // lazy fix to get rid of extra label from user-name attributed caption
$reX = "$reX" . quote("$opM - " . quote("$tk", 1) . " - $tkRE item(s)") . " Load(" . quote('*') . "," . quote($reLB . $opM . ';-;' . $reLX) . ")" . "<crlf>" . "$re";
if($flg == "1") { }
elseif($flg != "1") { $flg = "3"; }
//$flg means "style", here: 1, normal; 2, check mark; 3, bold check mark
$reX = "$reX" . quote("$opM <- back |: 00 |$flg : _ 00 0" . "$opM") . " Load(" . quote('*') . ") ;" . "<crlf>";
$flg = "x";
$opM++;
status "doing: menu $opM";
$re = "";
$reLX = "";
$op = "1";
if ($opF >= $tt) { $op = $tt + 1; }
else { }
}
else { }
}
status "menu generated.";
if($reX == "") { $reX = quote("Run") . " Load(" . quote('*') . "," . quote($reLX) . ")" . "<crlf>" . "$re"; load $reX, , s; }
else {
load "$reX", , s;
}