"Recursive" error, when failed, but forgot to close err win

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

: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: Use Your Profile Or Signature
We strongly 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, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
aliteralmind
Posts: 261
Joined: 02 Dec 2014 16:49

"Recursive" error, when failed, but forgot to close err win

Post by aliteralmind »

Save the following as "C:\Users\user\temp\test.xys"

Code: Select all

$rootdir = "C:\Users\aliteralmind\AppData\Roaming\Sublime Text 3";
   $srcdir = $rootdir."\Packages\User\notes_and_backup\SideBarEnhancements_my_tweaks";
   $destdir = $rootdir."\Packages\SideBarEnhancements";

   //Duplicate file as "zip"
   //http://www.xyplorer.com/xyfc/viewtopic.php?f=2&t=13073
   $pkgFile = $rootdir."\Installed Packages\SideBarEnhancements.sublime-package";
   $pkgFileZip = $pkgFile.".zip";

   //Missing comma! Bad!
   copyitem "$pkgFile" "$pkgFileZip";
Call it in the address bar with

Code: Select all

:: load "C:\Users\user\temp\test.xys"
It gives you this error:

Image

Do not close this dialog. Instead, click on the address bar again, and execute the same script. Now it thinks the script is recursive:

Image
Windows 8.1, 64-bit

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

Re: "Recursive" error, when failed, but forgot to close err

Post by highend »

And the error is where? The old script isn't finished, you didn't close the error dialog. It's called again. It doesn't know from where it was called so it thinks it's "caught in a recursive loop".

Btw, setting "AllowRecursion";
would probably omit this "problem" but why don't you fix the user error first? xD
One of my scripts helped you out? Please donate via Paypal

aliteralmind
Posts: 261
Joined: 02 Dec 2014 16:49

Re: "Recursive" error, when failed, but forgot to close err

Post by aliteralmind »

As a new XY scripter, it appeared to be a bug. This is the first I've heard of AllowRecursion and the setting command.

With

Code: Select all

setting "AllowRecursion", 0;
as the first line in the script, it still gives the recursive error.

What should it be?
Last edited by aliteralmind on 03 Jan 2015 21:07, edited 1 time in total.
Windows 8.1, 64-bit

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

Re: "Recursive" error, when failed, but forgot to close err

Post by highend »

Help file?...

You disabled "allow recursion"^^
One of my scripts helped you out? Please donate via Paypal

aliteralmind
Posts: 261
Joined: 02 Dec 2014 16:49

Re: "Recursive" error, when failed, but forgot to close err

Post by aliteralmind »

I did read the help file.

Setting AllowRecursive to 0 (disabling it) results in the same "The script appears to be recursive" error, which is what threw me.

I didn't try both values, though, and I should have before posting again. With 1 (enabling recursion), you get this on the second and third instances:

Image

I find both to be confusing. I wish the error message for the 0 value was something like "Script already running. Cannot start another instance (AllowRecursive=0)" instead of "The script appears to be recursive".
Windows 8.1, 64-bit

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

Re: "Recursive" error, when failed, but forgot to close err

Post by highend »

results in the same "The script appears to be recursive" error
Ofc it does. Setting it to 1 / leaving that parameter out disables the recursion warning.
With 1 (enabling recursion), you get this on the second and third instances
Exactly. No recursion error but ofc your scripting error (the missing comma).
One of my scripts helped you out? Please donate via Paypal

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

Re: "Recursive" error, when failed, but forgot to close err

Post by PeterH »

Hm, yes, user error, no doubt.

Though I think the reaction of XY is a bit strange.
Either it should not allow to start a new script while the old isn't terminated,
or, if it allows to start a new script, it should not name this a recursion.

I think I'd expect the first version.

Right: not a very big problem :roll:

Post Reply