Page 1 of 1
Scripting error
Posted: 18 Apr 2015 23:31
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
Re: Scripting error
Posted: 18 Apr 2015 23:40
by highend
And which error is that?
Tried it with v15.00.0400 and v15.00.0401, works fine...
Re: Scripting error
Posted: 19 Apr 2015 08:30
by bdeshi
Try this
btw while ^that^ works, this is syntactically cleaner
Re: Scripting error
Posted: 19 Apr 2015 13:35
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.
Re: Scripting error
Posted: 19 Apr 2015 13:39
by admin
Your script works fine here. No error.
How do you call the script?
Re: Scripting error
Posted: 19 Apr 2015 14:34
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;
Re: Scripting error
Posted: 19 Apr 2015 15:27
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");
Re: Scripting error
Posted: 19 Apr 2015 16:44
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.
Re: Scripting error
Posted: 19 Apr 2015 16:55
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.
Re: Scripting error
Posted: 19 Apr 2015 17:44
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?
Re: Scripting error
Posted: 19 Apr 2015 18:11
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.
Re: Scripting error
Posted: 20 Apr 2015 11:48
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.)
Re: Scripting error
Posted: 20 Apr 2015 11:59
by bdeshi
[expunged]
Re: Scripting error
Posted: 20 Apr 2015 12:49
by PeterH
Sammay, before writing you should have a look at the documentation
It says:
"Parentheses around the expression are mandatory."
(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...)
Re: Scripting error
Posted: 20 Apr 2015 12:56
by bdeshi
well, oops.