Scripting Bugs

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Scripting Bugs

Post by bdeshi »

In my view it's a bug.

If a separator is provided, it's inserted between items; one extra separator is not added at the end.

If a separator is not provided, "records are returned one per line"; one extra line added at the end => implies an empty item, or an extra separator: bug in either case.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Filehero
Posts: 2719
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Scripting Bugs

Post by Filehero »

Hi Peter,

seems we like discussing. :lol:
PeterH wrote:Maybe, if I didn't understand you wrong, you should just use separator <crlf>
That's exactly why I've chosen my example because it clearly show it's a bug. In this special case it's just by accident that the explicit separator happens to have the same semantic as the default one.
Of course, in simple scripts this all doesn't really matter, on those one/two pagers it's merely trial & error anyway. But with larger ones, perhaps including different script files, we all know things can quickly get nasty. Especially when after a long time a ticket enforces you return to the mess you one created. :mrgreen:

FH - dreaming of arrays, hashmaps & user-defined functions

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Scripting Bugs

Post by PeterH »

I would be with you, if the sep operand would specify that the default is <crlf> :arrow: then empty sep and <crlf> would have to be identical.

But separator says: "If missing records are returned one per line."
This is not "identical <crlf>". And a line, even the last, can be ended by a line ending.
So no: for me no :bug:

But at the end: Don must decide (or ignore) :whistle:

Edit: @FH: from you last post our difference seems to be the interpretation of default?

Filehero
Posts: 2719
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Scripting Bugs

Post by Filehero »

PeterH wrote:Edit: @FH: from you last post our difference seems to be the interpretation of default?
Sort of yes. More correct, it is the fact, that a formatting detail is changing the semantic of the function by adding a ghost entry to a list.

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Scripting Bugs

Post by PeterH »

OK: last try to explain my understanding:

Per default the list is a list of *lines* (each ended by crlf).
If you want a list of *tokens* ('records') you must use the separator operand, which is documented to *separate* the tokens. Here no separator follows the last token.

I think, for a list of lines, possibly used for output, the final crlf can be expected, while for a list of tokens, interpreted by script logic, it should not.

As long as this interpretation is possible, I would at least not call it a bug.
OK: if it *is* meant this way, documentation could be a bit more clear for that - to avoid problems with empty operand when looping.

To your last sentence: is it wrong that a formatting detail distinguishes between lines and tokens? A matter of formatting for output or for automated handling?

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

! SC Property: No longer opened the Shell Properties dialog.

Neither of these examples works in fresh v15.00:

Code: Select all

property(, "<xypath>\<xyexe>"); //show Properties for XYplorer
property(); //show Properties for current item

admin
Site Admin
Posts: 65060
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Bugs

Post by admin »

Confirmed and fixed, thanks.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Scripting Bugs

Post by bdeshi »

there something weird with angle brackets in comparison expressions:

Code: Select all

 echo <get countselected> > 1; echo (<get countselected>) > 1;
 echo 1 < <get countselected>; echo 1 < (<get countselected>);

 echo <xyver> > "12.00.0000"; echo (<xyver>) > "12.00.0000";
 echo "12.00.0000" < <xyver>; echo "12.00.0000" < (<xyver>);
when the part following a < start with <

ed. @Pete: happy now? :x
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Scripting Bugs

Post by PeterH »

SammaySarkar wrote:there something weird with angle brackets in comparison expressions:

Code: Select all

 echo <get countselected> > 1; echo (<get countselected>) > 1;
 echo 1 < <get countselected>; echo 1 < (<get countselected>);

 echo <xyver> > 12.00.0000; echo "<xyver>" > 12.00.0000;
 echo 12.00.0000 < <xyver>; echo 12.00.0000 < "<xyver>";
when the part following a < start with <
Basically you seem right: the 2nd and 4th line show wrong results: :bug:

But for the last 2 lines: 12.00.0000 isn't a (valid) number, but a string. So I expect it should be quoted.
<xyver> is a variable - no reason to quote. (But not wrong.)
(Sorry :P )

admin
Site Admin
Posts: 65060
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Bugs

Post by admin »

Comfirmed and fixed. Good find! :tup:

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Scripting Bugs

Post by bdeshi »

tab('get', 'term') isn't returning VFs. QS is good.

Code: Select all

::goto "<xypath>?exe"; echo tab('get', 'term');goto "<xypath>|exe"; echo tab('get', 'term');
tab() reference wrote:"term": the path including any Visual Filter or Quick Search (same as menu View | Tab | Copy Location Term).
btw, that Copy Location Term also forgets about VFs.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 65060
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Bugs

Post by admin »

Works fine here. Both. :?

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Scripting Bugs

Post by bdeshi »

:veryconfused: I only get the <curpath> , even in ::fresh!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 65060
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripting Bugs

Post by admin »

OK, it depended on Configuration | Find Files & Branch View | Visual Filters | Show filter information in tab headers.

Next version will always work.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Bugs

Post by TheQwerty »

This old bug seems to still exist...
TheQwerty wrote: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';
The results I expect are these:
TheQwerty wrote:That they would more closely resemble the results shown for the scripts marked "Correct". ;)
[i]Load A;B - Confused > A[/i] wrote:Myself:
Text "Myself:<crlf>" . Self('script') . "<crlf 2>Caller:<crlf>" . Caller('script');

Caller:
Load '*', 'A;B';
[i]Load A;B - Confused > B[/i] wrote:Myself:
B


Caller:
Load A;B - Confused

Post Reply