Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!boulder!pratt From: pratt@csn.org (Jonathan Pratt) Subject: Re: Why won't ResError return the right message? Message-ID: <1991May9.040511.26710@colorado.edu> Sender: news@colorado.edu (The Daily Planet) Nntp-Posting-Host: fred.colorado.edu Organization: University of Colorado Boulder, OCS References: <12946@pt.cs.cmu.edu> <1991May8.031012.1845@cbnewsk.att.com> <1991May8.055136.27101@neon.Stanford.EDU> Date: Thu, 9 May 1991 04:05:11 GMT Lines: 30 In article <1991May8.055136.27101@neon.Stanford.EDU> kaufman@neon.Stanford.EDU (Marc T. Kaufman) writes: >In article <1991May8.031012.1845@cbnewsk.att.com> ech@cbnewsk.att.com (ned.horvath) writes: >>From article <12946@pt.cs.cmu.edu>, by hairston@henry.ece.cmu.edu (David Hairston): > >-> there's a no-brainer which has worked its way into my code (C example): > >-> #define goodHand(x) ((x) && *(x)) > > >And just to make it worse, *handle won't be NULL for a purged resource, >but StripAddress(*handle) will be. The purge and resource bits are still >on (at least in 24 bit memory models). > Come on. Programming the Mac is enough work without this kind of dis- information. Next time get a reference. From Inside Mac: Before attempting to access any purgeable block, you must check its handle to make sure the block is still allocated. If the handle is empty (that is, h^ = NIL, where h is the handle), then the block has been purged; ... Last I heard, NIL still means zero. :-) Jonathan -- /* Jonathan Pratt Internet: pratt@boulder.colorado.edu * * UCHSC, Box A034 uucp: ..!ncar!boulder!pratt * * 4200 E. Ninth Ave. * * Denver, CO 80262 Phone: (303) 270-7801 */