Re: Scripting Bugs
Posted: 11 Feb 2014 09:38
Agreed, I make it 1/0.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
I'm not sure how far back it can support currently.admin wrote:So your script will also run with older versions of XY. With IsUnicode it probably would not...
Code: Select all
"Test"
$IS_UNICODE_FALSE = IsUnicode('a');
$tests = 'abc|€|';
$results = '';
foreach ($test, $tests, '|') {
$verdict = (IsUnicode($test) != $IS_UNICODE_FALSE) ? 'is' : 'is not';
$results = $results . "'$test' $verdict unicode.<crlf>";
}
Text $results;Code: Select all
::goto "<xy>";$f = "<focitem>";Sel '-1';SelectItems $f, 2, 0;Echo "Variable: <curitem><crlf>Get: <get curitem>";Code: Select all
> FYI, <get curitem> is not the same as <curitem>:
- <curitem> = the currently selected and focused item.
- <get curitem> = the currently selected and focused item, or of there is
none the previously selected and focused item.
It's confusing but perfectly fine for them to be different.admin wrote:Ahem, no. That fix was not good. Actually both variables are NOT the same.
Code: Select all
> FYI, <get curitem> is not the same as <curitem>: - <curitem> = the currently selected and focused item. - <get curitem> = the currently selected and focused item, or of there is none the previously selected and focused item.
Code: Select all
::help('idh_scripting_comref.htm#idh_sc_get');Code: Select all
"Menu of omission." Text PopupMenu("a|-|b|c",,,,); // Correct. Menu is shown.
"Menu of empty." Text PopupMenu("a|-|b|c",,,,''); // ?... Menu is not shown.
"Menu of 1" Text PopupMenu("a|-|b|c",,,,1); // Correct. Menu of just 'a' is shown.
"Menu of 0" Text PopupMenu("a|-|b|c",,,,0); // Correct. No menu is shown.
"Menu of All" Text PopupMenu("a|-|b|c",,,,-1); // Incorrect. No menu is shown.
"Menu of All (Quoted)" Text PopupMenu("a|-|b|c",,,,"-1"); // Incorrect. No menu is shown.
"Menu of All (Var)" $count = -1;Text PopupMenu("a|-|b|c",,,,$count); // Incorrect. No menu is shown.Code: Select all
"A" Text "Myself:<crlf>" . Self('script') . "<crlf 2>Caller:<crlf>" . Caller('script');
"B" Text "Myself:<crlf>" . Self('caption') . "<crlf 2>Caller:<crlf>" . Caller('caption');
-
"Sub - Correct" Sub 'A'; Sub 'B';
"Load A - Correct" Load '*', 'A';
"Load B - Correct" Load '*', 'B';
-
"Load A;B - Confused" Load '*', 'A;B';