Page 1 of 1
"Recursive" error, when failed, but forgot to close err win
Posted: 03 Jan 2015 19:57
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:
Do not close this dialog. Instead, click on the address bar again, and execute the same script. Now it thinks the script is recursive:

Re: "Recursive" error, when failed, but forgot to close err
Posted: 03 Jan 2015 20:09
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
Re: "Recursive" error, when failed, but forgot to close err
Posted: 03 Jan 2015 20:20
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
as the first line in the script, it still gives the recursive error.
What should it be?
Re: "Recursive" error, when failed, but forgot to close err
Posted: 03 Jan 2015 20:47
by highend
Help file?...
You disabled "allow recursion"^^
Re: "Recursive" error, when failed, but forgot to close err
Posted: 03 Jan 2015 21:03
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:
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".
Re: "Recursive" error, when failed, but forgot to close err
Posted: 03 Jan 2015 21:10
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).
Re: "Recursive" error, when failed, but forgot to close err
Posted: 04 Jan 2015 00:03
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
