Roger had it correct... EvtGetEvent will generate a nilEvent IFF there are
no events in the queue for the timeout period.
I would place the nilEvent handler in the event handler routine of the form
that is displayed.  You could put it in the main event loop if this is the
timing routing for gathering your telemetry (which I assume you wish to
always gather while your app is executing).  The key is to check the tick
count or the real-time clock when a nilEvent occurs to find out if you need
to perform you data gathering.  UI elements have a habit of using nilEvents
(as well as the OS) to perform certain 'things' so you are never certain if
EvtGetEvent or something else generated the nilEvent.  Reptoids is a good
example to follow, if you need a different example, email me off the group.

-----Original Message-----
From: Stuart Norton <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, July 14, 1999 12:45 PM
Subject: RE: Automated serial output


Dave,

If the EvtGetEvent times out, it generates a 'nilEvent' right? Do I just
stick another case statement right under the EvtGetEvent to handle this?
Does it matter where?

Stuart Norton


-----Original Message-----
From: Dave Lippincott [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 14, 1999 4:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Automated serial output


You're going to have to fudge it.  Set your app to generate the nilEvent
event with at least 2x the required frequency and check the ticks (or the
clock) to see if it is time to perform your task.  I have not found a
reliable way to generate a periodic event at an *exact* interval (and still
use the OS API's).  You could also look into using the alarm manager, but an
event every 2 seconds may not be worth the overhead.  Several developers
have posted numerous help messages on this topic in the past months, you can
search egroups for their answers.

D

-----Original Message-----
From: Stuart Norton <[EMAIL PROTECTED]>
To: Palm Developers Forum List (E-mail) <[EMAIL PROTECTED]>
Date: Wednesday, July 14, 1999 10:36 AM
Subject: Automated serial output


Hi,

Just a quickie to those in the know: How do I call a function every 2
seconds no matter what's happening in my app. I presume there's a command to
post regular events of a certain type onto the queue, that can then be
handled however I want. If so, what is this?

Thanks

Stuart Norton









Reply via email to