My Scrabble clone takes ~15 seconds or more to find a move under some
circumstances (like if there's a blank involved).  I want to allow
users to cancel the operation, and if possible I want to resume later
from where I stopped.

First off, is there a tech note or other discussion available on the
subject?  I've had no luck searching Palm's site -- it's not very lynx
friendly. :-)

Alternatively, here's what I've tried.  Comments, anyone?

1. Periodically inside the calculation I call EvtEventAvail().  If it
returns true I throw up a dozen or so stack frames, package up some
state into a custom event, and post it.  I then return via the normal
route up to the main application event loop.

2. On receipt of the custom event I reenter the calculation beginning
at the state saved in the event.

The problem is that EvtEventAvail() never returns false, even though
the only event on the queue is the custom event I'm currently
processing.  I'm guessing that an event isn't removed from the queue
until the handler returns true (or until the OS has finished with it
if it returns false.)

So how do I work around this?  Is it ever possible for there NOT to be
an event available when you're testing from within event handling code?
Is there some event-masking test I've overlooked?

Thanks

+-------------------------------------------------------------------------+
|            from the desktop of: Eric House, [EMAIL PROTECTED]              |
|    "The instructions said 'Win98 or better' -- so I installed Linux"    |
+-------------------------------------------------------------------------+

Reply via email to