You need at least v17.60.0002 for this to work!
Code: Select all
$isFav = formatlist(favs("f"), "F", <crlf>, <curitem>);
if ($isFav) { tag 0; }
else { tag "Fav"; }
#565;
How are you guys scripting/debugging anyway?
<- Sublime Text
Other users have written syntax-highlighting files for iirc Notepad++, Akelpad,...
Debugging:
Code: Select all
step;
unstep;
A leading ? in front of a command
Or e.g.:
Code: Select all
function debug($str, $mode="a", $repeat=2, $sep=<crlf>) {
$editor = "D:\Tools\Sublime Text\sublime_text.exe";
$debugFile = "R:\~XYDebug.log";
if (exists("R:\") != 2) { echo "Ramdrive 'R:\' does not exist, no logging possible!"; }
if !(regexmatches($mode, "^(b|begin|a|append|e|end)$")) {
$message = <<<>>>
ERROR: The debug function knows only three modes:
01. b[egin]
02. a[ppend] -> Default
03. e[nd]
But it received: "$mode" instead!
>>>;
echo formatlist($message, "t", <crlf>);
end 1==1;
}
// Start mode
if (regexmatches($mode, "^(b|begin)$")) {
$message = "Start of debug log:";
$time = formatdate();
$div = strrepeat("=", strlen($message) + strlen($time) + 1);
$header = <<<>>>
$message $time
$div<crlf 2>
>>>;
writefile($debugFile, <crlf> . regexreplace($header, "^[ \t]+") . , "o", "tu");
// Append mode
} elseif (regexmatches($mode, "^(a|append)$")) {
writefile($debugFile, $str . strrepeat($sep, $repeat), "a", "tu");
// Stop mode
} elseif (regexmatches($mode, "^(e|end)$")) {
$message = "End of debug log:";
$time = formatdate();
$div = strrepeat("=", strlen($message) + strlen($time) + 1);
$footer = <<<>>>
$div
$message $time<crlf>
>>>;
writefile($debugFile, <crlf> . regexreplace($footer, "^[ \t]+") . , "a", "tu");
run """$editor"" ""$debugFile""", <xypath>;
}
return;
}
Which can help to gather larger amounts of data from a script and display it in your favorite text editor
(which hopefully autoreloads that file once it's updated)