Runtime stack overflow error -2650


I posted this e-mail to the quark list but didn’t get any help. I see a lot of scripting discussions on this list so maybe someone here can help me. I didn’t include the script because it is quite long. If you would like to see it, please contact me off list.

I have written a script for Quark 4.11 running in classic on OSX. When the script is open in Script DeBugger 3.0.6 it runs just fine. It complies ok. However, when I go to save it as an application, I get a -2706 runtime stack overflow error and it won’t save as an application or even as a compiled script.

I do have some variables that are quite large. Do I need to clear these variables somehow to get rid of this error? If so, how do I do that. Any other ideas of what might be wrong to produce this error?

Yeah, this sounds familiar. Try restructuring your script:


on main()
    [your code]
end main

All variables within the handler are thrown away once the handler ends.

If the above doesn’t work, it may be an OS X running Classic thing, in which case I don’t have any other ideas, sorry.

Thank you. Making the bulk of my script function in a handler worked. I no longer get the runtime error. :lol: