Scripting Bugs

Things you’d like to miss in the future...
bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

admin wrote:Next version you can report those columns via their captions. :cup:
this still only for the first five?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Scripting Bugs

Post by admin »

SammaySarkar wrote:
admin wrote:Next version you can report those columns via their captions. :cup:
this still only for the first five?
No, for all (as long as they are shown in the current list).

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

okay, it doesn't seem to work when report()'s itemlist param is filled.

Code: Select all

::text report("{SomeCCCaption}<crlf>"); // return == expectation
::text report("{SomeCCCaption}<crlf>",<curitem>); // return != expectation
also how to choose between two CCs both of which happen to have the same caption? Now CCs are prioritized based on when they were added to list.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Scripting Bugs

Post by admin »

Yes, it only works for the list.
Improvements later.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

sc savethumb() doesn't add default/defined extension to created thumbfile if source item name has extra .'s .

Code: Select all

  echo savethumb("E:\Test.pdf"       , , 400, 500, "png"); //creates E:\Test_thumb.png
  echo savethumb("E:\Test.source.pdf", , 400, 500, "png"); //creates E:\Test.source_thumb
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Scripting Bugs

Post by admin »

Thanks, confirmed and fixed.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

default values of function parameter variables are not
processed like elsewhere.
[code] text f1(),,,'f1() out';text f2(),,,'f2() out';text f3(),,,'f3() out';
 text 'start'.'<crlf>'.<crlf>."<crlf>".'end',,,'regular out';
function f1($lf1 = '<crlf>', $lf2 = <crlf>, $lf3 = "<crlf>"){
  return 'start' . $lf1. $lf2 . $lf3 . 'end';
}
function f2($lf1 = '<crlf>', $lf2 = <crlf>, $lf3 = "<crlf>"){
  $lf1 = $lf1;$lf2 = $lf2;$lf3 = $lf3;
  return 'start' . $lf1. $lf2 . $lf3 . 'end';
}
function f3($lf1 = '<crlf>', $lf2 = <crlf>, $lf3 = "<crlf>"){
  $lf1 = $lf1,r;$lf2 = $lf2,r;$lf3 = $lf3,r; //silly workaround
  return 'start' . $lf1. $lf2 . $lf3 . 'end';
}[/code]$lf1/'<crlf>' should stay literal, but the other two should not.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Scripting Bugs

Post by admin »

Default parameters are not evaluated at all. They are taken as literals. You cannot even use permanent variables as default parameters (and have them resolved). Nor constantss (and have them resolved).

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

so the silly workaround will have to remain in use.
I suppose you have your reasons... but the situation is inconvenient.
Here's hoping a better way reveal itself. :beer:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

Eh, sorry, but I don't like it. :(

If it's not a bug then it's at least a noticeable bump in the road to UDF perfection.
Constants/native variables should not suddenly become literal strings; it diverts from silently divert from regular scripting rules.
It's counter-intuitive : when I want a literal <crlf> string I use '<crlf>', else it must be processed.

So again, here's hoping you find a quick fix! :beer:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Scripting Bugs

Post by admin »

Just rechecked with PHP: Constants *are* resolved! But only if unquoted. Single and double quoted constants are not resolved.

In accordance to usage elsewhere in XY I will allow unquoted and double-quoted default parameters to be resolved (XY native vars and environment vars)
So I will make this work (resolve):

Code: Select all

 ..., $lf2 = <crlf>, $lf2 = "<crlf>", ...

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

aha! :appl: :appl: :appl:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 13308
Joined: 06 Feb 2011 00:33

Re: Scripting Bugs

Post by highend »

v15.00.0517

Something's wrong with writefile()...

Use this from the address bar:

Code: Select all

writefile("test.txt", "abc");
"No such argument" script error appears.
One of my scripts helped you out? Please donate via Paypal

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

Re: Scripting Bugs

Post by admin »

Whoops, fix soon.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Scripting Bugs

Post by bdeshi »

a little thing: changelog speaks of the mysterious aingle-quotes. :P
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply