home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18531 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.2 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!ux1.cso.uiuc.edu!mp.cs.niu.edu!uxa.ecn.bgu.edu!news.ils.nwu.edu!engber
  2. From: engber@ils.nwu.edu (Mike Engber)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Hilite a Rect
  5. Keywords: color, hilite, novice
  6. Message-ID: <1992Nov17.153747.28612@ils.nwu.edu>
  7. Date: 17 Nov 92 15:37:47 GMT
  8. Article-I.D.: ils.1992Nov17.153747.28612
  9. References: <1e9v71INNgqn@agate.berkeley.edu> <1eavmkINNojo@falcon.natinst.com>
  10. Sender: usenet@ils.nwu.edu (Mr. usenet)
  11. Organization: The Institute for the Learning Sciences
  12. Lines: 18
  13. Nntp-Posting-Host: aristotle.ils.nwu.edu
  14.  
  15. >I never use the BitClr function (for byte to long sized variables) because
  16. >you get the extra trap dispatch overhead.  The way I code my highlights is:
  17. >
  18. >    *(char*)HiliteMode &= ~(0x01<<hiliteBit);
  19. >
  20. >However, I don't know why your code using BitClr should cause a buss error.
  21.  
  22. My guess is the the original poster is using THINK C which defines globals
  23. as external vars - (not their addresses). From LoMem.h:
  24.  char HiliteMode : 0x938;
  25.  
  26. In which case your suggestion will suffer the same problem. He needs to use:
  27.  BitClr(&HiliteMode,pHiliteBit);
  28.  
  29. I made this same mistake myself recently. It's so easy (and foolish) to copy
  30. code right from IM w/o thinking.
  31.  
  32. -ME
  33.