Scripting error

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:
Post Reply
InTheMood
Posts: 61
Joined: 11 Mar 2012 13:39

Scripting error

Post by InTheMood »

The following script producers an error with the latest version of XY (15.00.0400)

"New Folder (Ctrl+N)";#231;

I tried #139 with the same results

highend
Posts: 14593
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting error

Post by highend »

And which error is that?

Tried it with v15.00.0400 and v15.00.0401, works fine...
One of my scripts helped you out? Please donate via Paypal

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

Re: Scripting error

Post by bdeshi »

Try this

Code: Select all

"New Folder (Ctrl+N)" #231;
btw while ^that^ works, this is syntactically cleaner

Code: Select all

"New Folder (Ctrl+N)"
  #231;
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

InTheMood
Posts: 61
Joined: 11 Mar 2012 13:39

Re: Scripting error

Post by InTheMood »

Your suggestion to remove the semicolon (;) did not work. Still the same error.

The error is: 'new' is not a script command.

Works fine in 15.00.0300, so I regressed to the previous version.

BTW is there a way to include an image of the error in this forum? I could't figure out how to include an image of the error message.

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

Re: Scripting error

Post by admin »

Your script works fine here. No error.

How do you call the script?

InTheMood
Posts: 61
Joined: 11 Mar 2012 13:39

Re: Scripting error

Post by InTheMood »

I am sorry, I think I gave you the wrong info.

I have the script assigned to a toolbar button.
The failing script is the left button, not the right. See below:

on left click:
$name = input("Enter Folder Name to be created in... ", "<curpath>\", "New Folder");
end ($name == "" || $name == " " ), "No name entered!";
new ("$name", dir);

on right click:
"New Folder (Ctrl+N)" #231;

highend
Posts: 14593
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting error

Post by highend »

Code: Select all

    $name = input("Enter Folder Name to be created in... ", "<curpath>\", "New Folder");
    end (!$name || regexmatches($name, "^\s+$")), "No name entered!";
    new($name, "dir");
One of my scripts helped you out? Please donate via Paypal

InTheMood
Posts: 61
Joined: 11 Mar 2012 13:39

Re: Scripting error

Post by InTheMood »

Highend, Is the above script a emplacement?

Did the script rules change?

Will XY be "fixed", or do I have to change the script?

For now, I am sticking with 15.00.0300.

highend
Posts: 14593
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Scripting error

Post by highend »

Highend, Is the above script a emplacement?
A replacement? Yeah...
Did the script rules change?
Why?

You've used new (...
but it's new(...
Hence the error.
Will XY be "fixed", or do I have to change the script?
No clue what you mean.
One of my scripts helped you out? Please donate via Paypal

InTheMood
Posts: 61
Joined: 11 Mar 2012 13:39

Re: Scripting error

Post by InTheMood »

My old script worked for a few years, in XY.
Something changed in 15.00.0400.
15.00.0300 still works, using the original script.

My question was related to the above facts.

Was this a bug introduced in 15.00.0400 that will be reversed?

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

Re: Scripting error

Post by admin »

InTheMood wrote:My old script worked for a few years, in XY.
Something changed in 15.00.0400.
15.00.0300 still works, using the original script.

My question was related to the above facts.

Was this a bug introduced in 15.00.0400 that will be reversed?
Confirmed. I recently (20150410) added an optimization that failed on the (slightly anarchic) syntax you are using. The next beta will work again as before.

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

Re: Scripting error

Post by PeterH »

admin wrote:Confirmed. I recently (20150410) added an optimization that failed on the (slightly anarchic) syntax you are using. The next beta will work again as before.
I completely understand, that for func( $parms ) there should be no blank in front of the first parentheses.

But, for example: how should it be for If( ... ) - is there the same rule, or is it something different?
(Just to verify. I'd expect: different situation.)

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

Re: Scripting error

Post by bdeshi »

[expunged]
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 error

Post by PeterH »

Sammay, before writing you should have a look at the documentation :whistle: :wink:
It says: "Parentheses around the expression are mandatory." :ugeek:
(Yes: it's changed some time ago, and still works without.)
For Foreach and While it always was this way.
So there "might" be a risk that Don planned those to be without blank. Though I still don't think so.

I still wish(!) XY would notify users of such situations, so they could be corrected.
(Not long ago there was some discussion about "XY should handle syntax more strict". I think this belongs there...)

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

Re: Scripting error

Post by bdeshi »

well, oops.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply