Hi,
I really need help with stopping the infinite loop by pushing "Done" button. I already tried several different ways for solving the problem. However, it didn't have any action when I pushed the button. I include my code here. I will very appreciated any help.
 
static Boolean ldu_handler(EventPtr event)
{ // handles the events within the ldu form
   FormPtr   form;
   UInt       handled = 0;
   UInt          index;
   VoidHand      RecHandle;
  Ptr           RecPointer;
 
 
   form = FrmGetActiveForm();
 
   switch (event->eType)
   {
     case frmOpenEvent:
      serial_open();
        FrmDrawForm(form);
        handled = 1;
        
        do_channel();
        break;
 
     case frmCloseEvent:
      // processes that occur as the OS closes this form
        ldu_close();
        FrmHandleEvent(FrmGetActiveForm(), event);
        handled = 1;
        break;
   
     case ctlSelectEvent:
        if (event->data.ctlEnter.controlID== buttonID_ldu_done)
     { // if user pushes the done button, return to main form
         runLoop = 0;
          FrmGotoForm(formID_main);
          handled = 1;
        }
            break;
  
 
     case nilEvent:
        handled = 1;
        break;
 
   }
   return handled;
}
 

static void do_channel()
{
    for (temp = 0; temp<2; temp++)
    {
   
  if (temp == 0) {
  }
  else {
      runLoop = 1;
  }   
 } 
 
// Handle_Old_MF_Data();
while (runLoop)
 { 
 if ( x[0] == 1)
 {
 }
 else  {
 }
 if (EvtEventAvail())
      {
         EventType event;
         EvtGetEvent(&event, 0);
         if (event.eType == penDownEvent)
            runLoop = 0;
      }
 
}
 FrmGotoForm(formID_main); // loop done; goto main form
     
}
 
Allen
-----Original Message-----
From: Gianluca Barbaro [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 02, 1999 1:16 PM
To: [EMAIL PROTECTED]
Subject: Re: How to stop infinite loop by push button or some other ways?

Sorry: not important, but actually I was wrong


At 19.05 02/09/99 +0200, I wrote:

>>>>

        ...

        err=EvtFlushPenQueue();

       

        for (i=start; i

        {

                if (EvtSysEventAvail(false))

                        break;

        ...


By passing "false" to EvtSysEventAvail, you ignore the penUp events.

<<<<



It's the contrary: by passing "false" to EvtSysEventAvail, you **don't** ignore penUp events.


Sorry again,

GL

-----------------------------------------------------------------------------

Gianluca Barbaro

Storm Comunicazione & Tecnologia - Via B. De Rolandi, 1 - 20156 Milano - Italy

tel. +39-02-33.00.74.68 - fax +39-02-39.21.54.84

mailto:[EMAIL PROTECTED] - web site: http://www.storm.it


Makers of http://www.wincearch.com

the search engine for Windows CE


Makers of http://www.palmpointer.com

the search engine for Palm Computing Platform

-----------------------------------------------------------------------------


Reply via email to