"Dave Johnson" <[EMAIL PROTECTED]> wrote in message
news:12758@palm-dev-forum

This just happens to be one situation I ran into early on and investigated.

> That's a tough one, actually: do you want a strict emulator that always
> behaves exactly like the real device, or one that does some extra,
> non-device things that may be helpful in flushing out bugs? In my one
> case (admittedly rare) those extra things actually masked a bug for a
> while...still, I think I'd choose the latter.
Actually the nilEvent can occur in a variety of other circumstances depending
on which OS version or hardware platform you have. You should never use a
nilEvent as a dependable measure of time. Always check the absolute time or
time passed and make the decision yourself. There is no periodic event timer
in PalmOS. The only purpose of a nilEvent is to fire idle time events, not act
as a timer. The timeout given in evtGetEvent is only an approximate time after
which it will generate a nilEvent. This does not mean, however, that some
other process will not fire one before the timeout or that the one fired by
evtGetEvent will happen precisely on that time.

Another way is to check the time before evtGetEvent. If it is time then you
perform the timed procedure, reset the timer check, and then drop through to
the evtGetEvent.

> The one suggestion I might make is to make it explicit: I looked in the
> docs and couldn't find anything about this...did I just miss it?
In the PalmOS SDK v3.5 docs: "Palm OS Reference". In "User Interface | Palm OS
Events | Event Reference | nilEvent".

<quote>
...
Different Palm OS versions and different devices can send nilEvents under
different circumstances, so you might receive a nilEvent even before the
timeout has expired.
...
<endquote>

As such the pattern of nilEvents generated by POSE is correct behavior. I have
never found mention of this in what passes for POSE documentation or in any of
the versions of a tutorial. But then I've never seen a Palm PalmOS tutorial
that correctly compiled or ran so I was just lucky to run into this one early.

I hope you find this helpful.
--
The Snake Pit - Development
Curtis Clauson    [EMAIL PROTECTED]
Proprietor





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to