Page 19 of 41

Re: Scripting Bugs

Posted: 11 Feb 2014 09:38
by admin
Agreed, I make it 1/0.

Re: Scripting Bugs

Posted: 11 Feb 2014 13:29
by TheQwerty
Much improved in 13.70.0126.

Sad part is I rewrote that part of the script and no longer need IsUnicode.
Oh well! :whistle:

Re: Scripting Bugs

Posted: 11 Feb 2014 13:38
by admin
So your script will also run with older versions of XY. With IsUnicode it probably would not... :whistle:

Re: Scripting Bugs

Posted: 11 Feb 2014 13:56
by TheQwerty
admin wrote:So your script will also run with older versions of XY. With IsUnicode it probably would not... :whistle:
I'm not sure how far back it can support currently.

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

Posted: 11 Feb 2014 14:06
by admin
Yes, clever!

Re: Scripting Bugs

Posted: 18 Feb 2014 22:20
by TheQwerty
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:

Code: Select all

::goto "<xy>";$f = "<focitem>";Sel '-1';SelectItems $f, 2, 0;Echo "Variable: <curitem><crlf>Get: <get curitem>";
This might just need clarifying in help but it smells like a :bug: to me... :?

Re: Scripting Bugs

Posted: 19 Feb 2014 08:58
by admin
I'd say :bug: . Next version both will show "".

Re: Scripting Bugs

Posted: 19 Feb 2014 12:38
by admin
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.

Re: Scripting Bugs

Posted: 19 Feb 2014 12:40
by LittleBiG
And probably this fix messed up the comparing.

Re: Scripting Bugs

Posted: 19 Feb 2014 12:54
by admin
Yep.

Re: Scripting Bugs

Posted: 19 Feb 2014 12:55
by TheQwerty
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.
It's confusing but perfectly fine for them to be different.

"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

Posted: 19 Feb 2014 12:59
by admin
Thanks, done.

Re: Scripting Bugs

Posted: 24 Feb 2014 18:53
by TheQwerty
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

Posted: 25 Feb 2014 14:19
by admin
Yep, fix comes.

Re: Scripting Bugs

Posted: 26 Feb 2014 21:43
by TheQwerty
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';