lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm brand new to the Lua community. I've read through the archive and
documentation and haven't found this answer yet so I figure I'd ask the
experts.

I'm trying to use Lua on a single process machine (Palm) to sumulate a
second process. This is for a test driver that I'm writing. My goal is to be
able to write a Lua script that does things like 1) Starts an application,
2) selects a menu item, 3) enters text, 4) clicks a "done" button, etc. My
thinking was that I could drive the Lua interpreter much like a debugger. I
would occasionally (let's say on an idle event) do the equivalent of a
"step" in the debugger.

My problem is that Lua doesn't seem to be stateless. It drives the debugger
via hooks instead of the other way around. I've figured out how to use
lua_sethook to specify my callback functions, but what I need to do here is
give control back to the OS and resume the interpreter later.

The debuggers I see either spawn a debugger thread, or a separate process.
Is there a way to do all of this in a single thread? Have I asked the
question intelligently?

Thanks for any assistance. Regards,

Chris Mumford