home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 22040 < prev    next >
Encoding:
Text File  |  1993-01-24  |  2.2 KB  |  77 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!hellgate.utah.edu!fcom.cc.utah.edu!quadra.chem.utah.edu!dmitry
  3. From: Dmitry Boldyrev <dmitry@chemistry.chem.utah.edu>
  4. Subject: I hate THINK Pascal...
  5. Message-ID: <1993Jan24.005729.13045@fcom.cc.utah.edu>
  6. X-Xxmessage-Id: <A5A4B32EBF01C4C9@quadra.chem.utah.edu>
  7. X-Xxdate: Thu, 23 Jan 92 15:00:14 GMT
  8. Sender: news@fcom.cc.utah.edu
  9. Organization: University of Utah
  10. X-Useragent: Nuntius v1.1.1d17
  11. Date: Sun, 24 Jan 93 00:57:29 GMT
  12. Lines: 63
  13.  
  14. Hello,
  15. I really hate THINK Pascal now!! :( Because, whatever I do,
  16. all couse problems..
  17. I'm working on Molecular Designer package and would like to write Floating
  18. palettes. Problem with Events, partcicularly with App4Evt, made me CRAZY!!
  19. If you have enought time, please take a look on this fragment of my code:
  20.  
  21.     procedure DoEvent (theEvent: EventRecord);
  22.     begin
  23.         case theEvent.what of
  24.             mouseDown: 
  25.                 DoMouseDown(theEvent);
  26.             activateEvt: 
  27.                 if BITAND(theEvent.modifiers, activeFlag) <> 0 then
  28.                     DoActivate(theEvent)
  29.                 else
  30.                     DoDeactivate(theEvent);
  31.             updateEvt: 
  32.                 DoUpDate(theEvent);
  33.             app4Evt: 
  34. (****)        case BITAND(theEvent.message, TypeMask) of
  35.                     suspendResumeEvt: 
  36.                         if BITAND(theEvent.message, SuspendResumeBit) <> 0 then
  37.                             DoResume(theEvent)
  38.                         else
  39.                             DoSuspend(theEvent);
  40.                 end;
  41.         end;
  42.     end;
  43.     procedure EventLoop;
  44.         var
  45.             theEvent: EventRecord;
  46.     begin
  47.         while running do
  48.             begin
  49.                 if WNEImplemented then
  50.                     begin
  51.                         if WaitNextEvent(everyEvent, theEvent, 0, nil) then
  52.                             DoEvent(theEvent);
  53.                     end
  54.                 else
  55.                     begin
  56.                         if GetNextEvent(everyEvent, theEvent) then
  57.                             DoEvent(theEvent);
  58.                         SystemTask;
  59.                     end;
  60.             end;
  61.     end;
  62.     
  63.     ++++++++++++++++
  64.     I set up "Break point" to (****) and I figured out that it NEVER EVER
  65.     comes to this point!!! -In other words, EVENT.
  66.     I thought, what can be wrong here!? Code seems absoulutely right!
  67.     Even, it works in THINK C!
  68.     Please, if anyone know what's the problem, HELP!    
  69.     
  70.     THANKS! :)
  71.     o=======================================o
  72.     I Dmitry Boldyrev.                      I
  73.     I Department of Chemistry,              I
  74.     I University of Utah SLC Utah.          I
  75.     I Inter. dmitry@chemistry.chem.utah.edu I
  76.     o=======================================o
  77.