At 1:28 PM -0400 4/12/01, HowY wrote:
>I've been flamed over this one in the while loop
>not using >= but it only seems to work as an equal...

You're kidding, right? You really don't see the hole in your "if (TimeTks == 
TimGetTicks())" logic below?


> TimeTks = TimGetTicks() + 110; // <- here's the delay
> while (!X){
>   if (TimeTks == TimGetTicks())
>         X=1;
>   } // Use the system time for a delay, for & while loops don't work
>    FrmEraseForm(frmP);     // erase active form
> }

If a system action stops the app from executing for some period of time during your 
while loop (e.g. interrupts become disabled, background thread suspends app thread, 
tick counter gets reset, etc.) it may never exit the loop. The correct test is "if 
(TimeTks < TimGetTicks())" and use a UInt32 for the TimeTks variable. You should also 
test for overflow in your initialization of TimeTks, though the only thing that would 
happen if TimGetTicks() + 110 overflowed a UInt32 is that the splash screen would go 
away immediately.

BTW, this approach may annoy your users, because they can't tap the screen or press a 
button to dismiss the splash screen. It's not at all Zen-of-Palm...

Best Regards,

Jim Schram
Palm Incorporated
Partner Engineering


-- 
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