Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!stanford.edu!neon.Stanford.EDU!kaufman From: kaufman@neon.Stanford.EDU (Marc T. Kaufman) Newsgroups: comp.sys.mac.programmer Subject: Re: Why won't ResError return the right message? Message-ID: <1991May8.055136.27101@neon.Stanford.EDU> Date: 8 May 91 05:51:36 GMT References: <12946@pt.cs.cmu.edu> <1991May8.031012.1845@cbnewsk.att.com> Organization: Computer Science Department, Stanford University, Ca , USA Lines: 19 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)) >- there is a distinction between handle==NULL and *handle==NULL for >resources: a NULL handle either doesn't exist or hasn't been initialized, >whereas a non-null resource handle which dereferences to a NULL indicates >a purged resource -- call LoadResource to pull the data in. 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). Finally: a use for StripAddress. Marc Kaufman (kaufman@Neon.stanford.edu)