Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!AppleLink.Apple.Com!Greg From: Greg@AppleLink.Apple.Com (Greggy) Newsgroups: comp.sys.mac.programmer Subject: Re: ResError Bug? Message-ID: <2641@internal.Apple.COM> Date: 5 Jul 89 01:25:55 GMT References: <5914@hubcap.clemson.edu> Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 30 In article <5914@hubcap.clemson.edu> mikeoro@hubcap.clemson.edu (Michael K O'Rourke) writes: > I am trying to read a PICT resource into my application. I have a > if-then statment which checks to see if the resource really existed, > but it never gets called in the error case. > > The code is: > > pict := PicHandle(Get1Resource('PICT',pictNumber)); > if ResError = noErr then > { do something} > else > { handle error } > > Well, i went in and found out that ResError ALWAYS returns noErr. > What's up? Get[1]Resource will return NIL if the resource is not present. ResError's "feature" of always returning noErr makes it useless in this case. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Greg Marriott + AppleLink: Greg + + Just Some Guy + + + "My phone is always busy" + Internet: Greg@AppleLink.Apple.Com + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Apple Computer, Inc. + + 20525 Mariani Ave, MS-46z, Cupertino, CA 95014 + + (408)974-busy + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++