home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / mac / oop / macapp3 / 170 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  1.2 KB

  1. Path: sparky!uunet!stanford.edu!apple!applelink.apple.com
  2. From: DEWAELE.W@AppleLink.Apple.COM (De Waele Willy - Gent,BE,IHD)
  3. Newsgroups: comp.sys.mac.oop.macapp3
  4. Subject: Re: TAppl.InstallCohandler mo
  5. Message-ID: <724097388.6934764@AppleLink.Apple.COM>
  6. Date: 11 Dec 92 18:04:00 GMT
  7. Sender: daemon@Apple.COM
  8. Organization: AppleLink Gateway
  9. Lines: 29
  10.  
  11.  
  12.  
  13. Indeed, Mark, debug versions (of frameworks and our own applications - MacApp
  14. and others) should be defensive programmed (which save a lot of time), i use
  15. the following technique taking your example:
  16.  
  17. TFoo::Something()
  18. {...
  19. #if qDebug
  20.    if (!IsObject(aCohandler)) {
  21.      SysBreakStr("TFoo::Something - aCohandler is invalid!");
  22.     return; }
  23. #endif
  24. ...
  25. }
  26.  
  27. I prefer to jump into SADE with an own error message (eventually with the
  28. returned OSErr error-code) than wasting my time searching the reason of the
  29. crash which can occur later. I use the same technique before calling Failures
  30. (Failure statement outside the if/endif).
  31.  
  32. SADE must be started up, but i think this is no problem because when working
  33. with MacApp 3.x, we need a lot of meg's (i don't like limited resources! - *The
  34. sky's the limit!*).
  35.  
  36. Of course there are alternatives (jumping into MacsBug, ...).
  37.  
  38. Willy
  39.  
  40.