Is there any difference in handling scripts?(user buttons vs Try Script)

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
eil
Posts: 1919
Joined: 13 Jan 2011 19:44

Is there any difference in handling scripts?(user buttons vs Try Script)

Post by eil »

I was experimenting and stumbled upon "strange difference": the script was running fine in Try Script window and same fine when loaded from a file - both with Step Mode and Syntax Checking enabled. But when i put that in a User Button, it led to constant crash = "Error 9. Subscript out of range.". And sometimes it was "Error 97. Cannot call friend function on object that is not an instance of defining class" = though there was no function inside. I even tried it in Fresh = same crash.

Sorry, can't provide the script to check - i got too irritated, concluded the approach is wrong and erased everything, to try other ways. Still i'd wish to understand what was that = maybe someone has some experience with these errors 9 / 97, and knows something about scripts "behaving different" in user buttons?..
Win 7 SP1 x64 100% 1366x768|1900x1080

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

Re: Is there any difference in handling scripts?(user buttons vs Try Script)

Post by admin »

Well, there should be no difference. Would have been interesting to see the script. :)

eil
Posts: 1919
Joined: 13 Jan 2011 19:44

Re: Is there any difference in handling scripts?(user buttons vs Try Script)

Post by eil »

Damn, Don, are you live-tracking the site or reading minds?! :shock: After my question was there for a week, i logged some 15 mins ago, made another "error 9" search, and already typed a message-request for at least some hints about those error 9 / 97 = and here's your message right in that moment!.. :ninja:

Still, is there at least some "definitive symptoms" that cause those 9/97, so i could try to catch same situation again? It was just too illogical when it said "out of range" from a button, but run fine from a Try Script, or "can't call function" - when there was none inside.(i don't use them ever, don't like the troubles connected)
Win 7 SP1 x64 100% 1366x768|1900x1080

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

Re: Is there any difference in handling scripts?(user buttons vs Try Script)

Post by admin »

Can't say, totally depends on the script. Error 97 is probably about context and recursion.

Post Reply