Page 1 of 1

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

Posted: 09 Nov 2026 03:46
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?..

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

Posted: 15 Nov 2026 11:56
by admin
Well, there should be no difference. Would have been interesting to see the script. :)

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

Posted: 15 Nov 2026 12:14
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)

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

Posted: 15 Nov 2026 12:23
by admin
Can't say, totally depends on the script. Error 97 is probably about context and recursion.