home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18676 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.8 KB  |  40 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!wupost!cs.utexas.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!csuley
  3. From: csuley@cs.cornell.edu (Christopher Suley)
  4. Subject: Word 5.0a silliness
  5. Message-ID: <1992Nov20.001343.3723@cs.cornell.edu>
  6. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  7. Date: Fri, 20 Nov 1992 00:13:43 GMT
  8. Lines: 30
  9.  
  10. If you have a copy of Microsoft Word 5.0a and a debugger handy, you
  11. might find this amusing.
  12.  
  13. * Start up Microsoft Word.
  14. * Begin typing.  Don't click the mouse anywhere.
  15. * Enter the debugger and set a trap on Word's calls to WaitNextEvent.
  16.   ("atba waitnextevent" in MacsBug)
  17. * Resume execution.
  18. * Don't type anything. Don't click the mouse.
  19. * Enjoy the fact that the debugger is never entered.
  20. * Now, hit a key.  You will fall into MacsBug at a call to WaitNextEvent.
  21. * Resume execution.  The character appears on the screen, and once again,
  22.   the debugger is never entered.
  23. * Click the mouse.  You should now start repeatedly getting breaks at
  24.   WaitNextEvent.
  25.  
  26. Once you start typing, Word never calls WaitNextEvent until you hit a key!
  27. If you click the mouse, it resumes calling WaitNextEvent regularly like a
  28. normal, well-behaved application, but as soon as you type, it will stop
  29. calling it and only call it when you hit a key.
  30.  
  31. If you have a copy of my little shareware trifle Zipple (available at
  32. sumex and mac.archive - it puts an animated image over your Apple menu title)
  33. you will notice an interesting side effect of this odd coding practice.
  34. Zipple will freeze up.  This is because it is written as a driver that
  35. gets time periodically.  The way the system gives drivers time is by calling
  36. WaitNextEvent.  Word doesn't call WaitNextEvent.  My driver doesn't get
  37. time, so it doesn't run.  I imagine other drivers that need time don't get
  38. called either.  Yuck.
  39.  
  40.