[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Terminating a script
- From: "Joshua Jensen" <jjensen@...>
- Date: Thu, 27 Dec 2001 17:49:07 -0700
> My biggest problem is that the user may close the host app
> while a script is executing. How should I terminate the
> script? Is there a hook that will let me tell Lua to stop
> interpreting code ASAP and return, much like it does when it
> encounters a runtime error? An alterative I've considered is
> a global 'running' flag which scripts must check periodically
> to see if they should abort processing (i.e. if not running
> then return end, or while running do somework() end).
>
> To complicate matters, I'm using Lua Threads, so a script may
> have spawned an arbitrary number of child threads.
I'm not sure about Lua Threads, but I do know you can call lua_error()
to dump you out of the currently executing script state.
Josh