Oops, please remove check for nilEvent, this is a bug.
I will fix mine as well.


-----Original Message-----
From: Michael Glickman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 November 2001 3:35 PM
To: Palm Developer Forum
Subject: RE: Problem with SysTaskDelay()


Ok, here is the extract from my code.
I serves a different purpose, but you can customize it.


/////////////                                          ////////////////////
// Just wasting time before an event or when time is up
// (a better alternative of SysTaskDelay)
// N.B. The WakeUp event is "swallowed".
void SuspendTask(UInt32 timeoutTicks, eventsEnum WakeUpEvent) 
{
        EventType event;
        UInt32 NextTicks;
        
        NextTicks = TimGetTicks()+ timeoutTicks;
        
        for (;;) {
          EvtGetEvent(&event, (Int32) timeoutTicks);
          SysHandleEvent(&event);       // No need for other stuff
          if (event.eType == nilEvent || event.eType == WakeUpEvent) break;
          timeoutTicks = TimGetTicks();
          if (timeoutTicks >= NextTicks) break;

          timeoutTicks = NextTicks - timeoutTicks;
        }
}


-----Original Message-----
From: Michael Glickman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 November 2001 3:18 PM
To: Palm Developer Forum
Subject: RE: Problem with SysTaskDelay()


The problem with SysTaskDelay that it really suspends the whole app
including event processing that makes is almost absolutely useless.

Instead of that I prever using an event loop which quits when
the time is up. You process events as usual, but you need
to re-adjust timeout for EvtGetEvent,and break when timeout
is negative or zero.

Michael



-----Original Message-----
From: Ravindra [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 November 2001 3:06 PM
To: Palm Developer Forum
Subject: Problem with SysTaskDelay()


Hi Everybody,
Can any body help me to solve my problem.
In one of mine application  I am having string about 10000 character's  ,now
I have to
display a line of 16 to 30 character's in a text field depending on user
selected font size.
Speed of display is also select by user it may be 1-10 lines per second.

I am using

   SysTaskDelay(SysTicksPerSecond()/set3)

method here set3 contains value selected by user as no.of lines per second
for display.

Now problem is user can any time stop display or may be read another string
by tapping
buttons provided .

But since I am using SysTaskDelay() method processor will stay in sleep mode
that's why
it won't respond for any of the event until whole sting is completely read.
So can any body  tell me how to do this .
It will be great if send me code snippet .

Thanx in advance

Regards
    Ravi


--------------------------------------------------------------
Nova Software, Mumbai, India



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

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

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

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