home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12788 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.4 KB  |  33 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!gatech!destroyer!ncar!ncar.ucar.edu!hpoppe
  3. From: hpoppe@ncar.ucar.edu (Herb Poppe)
  4. Subject: Re: Using GetNextEvent or WaitNextEvent...
  5. Message-ID: <1992Jul21.202141.3329@ncar.ucar.edu>
  6. Sender: news@ncar.ucar.edu (USENET Maintenance)
  7. Organization: National Center for Atmospheric Research
  8. References: <16JUL199216005351@gergo.tamu.edu>
  9. Date: Tue, 21 Jul 1992 20:21:41 GMT
  10. Lines: 21
  11.  
  12. In article <16JUL199216005351@gergo.tamu.edu> dave@gergo.tamu.edu (Dave 
  13. Martin) writes:
  14.  
  15. > What's the best way to implement a main loop which can get it's events
  16. > either from WaitNextEvent or GetNextEvent (if WNE isn't available on
  17. > that machine)?
  18.  
  19. > I was thinking along the lines of a boolean (hasWNE) and doing an:
  20.  
  21. >     IF (hasWNE AND WaitNextEvent(...)) OR 
  22. >               (NOT(hasWNE) AND GetNextEvent(...)) THEN... (Main Loop)
  23.  
  24. Note that both WaitNextEvent and GetNextEvent could be called depending on 
  25. how the compiler you use compiles AND and OR. The Pascal standard does not 
  26. require short-circuit evaluation of AND and OR. THINK Pascal (at least, 
  27. don't know about MPW) provides non-standard forms of AND and OR (I forget 
  28. the syntax) that always result in short-circuit evaluation.
  29.  
  30. Herb Poppe                 National Center for Atmospheric Research (NCAR)
  31. hpoppe@ncar.ucar.edu       1850 Table Mesa Dr.
  32. (303) 497-1296             Boulder, CO  80303
  33.