Scripting Bugs
Forum rules
When reporting a bug, please include the following information: your XYplorer version (e.g., v27.90.0047), your Windows version (e.g., Win 11), and your screen scaling percentage (e.g., 125%). We recommend adding your Windows version and screen scaling percentage to your profile or signature. This will make debugging much easier for us.
When reporting a bug, please include the following information: your XYplorer version (e.g., v27.90.0047), your Windows version (e.g., Win 11), and your screen scaling percentage (e.g., 125%). We recommend adding your Windows version and screen scaling percentage to your profile or signature. This will make debugging much easier for us.
Re: Scripting Bugs
Much improved in 13.70.0126.
Sad part is I rewrote that part of the script and no longer need IsUnicode.
Oh well!
Sad part is I rewrote that part of the script and no longer need IsUnicode.
Oh well!
-
admin
- Site Admin
- Posts: 64836
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Scripting Bugs
So your script will also run with older versions of XY. With IsUnicode it probably would not... 
FAQ | XY News RSS | XY X
Re: Scripting Bugs
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...
Given that IsUnicode returned the localized strings, if I cared about backwards compatibility and still needed IsUnicode surrounding it in Eval wouldn't have worked anyhow. I guess I would have had to do something like:
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;Re: Scripting Bugs
I always thought that Get('curitem') and its variable version <get curitem> were equivalent to <curitem>, but this doesn't seem to be true.
In a fresh XY:This might just need clarifying in help but it smells like a
to me... 
In a fresh XY:
Code: Select all
::goto "<xy>";$f = "<focitem>";Sel '-1';SelectItems $f, 2, 0;Echo "Variable: <curitem><crlf>Get: <get curitem>";-
admin
- Site Admin
- Posts: 64836
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Scripting Bugs
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.
FAQ | XY News RSS | XY X
Re: Scripting Bugs
And probably this fix messed up the comparing.
Re: Scripting Bugs
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.
"Note: This differs from the native variable <curitem> in that it will return the previously selected and focused item if the currently focused item is not selected."
Something like that under the 'curitem' section of the Get SC is more than enough.
Code: Select all
::help('idh_scripting_comref.htm#idh_sc_get');Re: Scripting Bugs
PopupMenu's count parameter only treats omitting it as -1.
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.Re: Scripting Bugs
Self and Caller enter a fugue state when Load displays a menu for multiple labels...
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';
XYplorer Beta Club