Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!kuhub.cc.ukans.edu!2fmlcalls From: 2fmlcalls@kuhub.cc.ukans.edu Newsgroups: comp.sys.mac.programmer Subject: Re: Why won't ResError return the right message? Message-ID: <1991May6.143630.30448@kuhub.cc.ukans.edu> Date: 6 May 91 14:36:30 CDT References: <1696@babcock.cerc.wvu.wvnet.edu> Organization: University of Kansas Academic Computing Services Lines: 25 > Even though GetResource couldn'thave found the resource (because > it wasn't there), ResError returned a 0, indicating that nothing > was wrong. Needless to say, the first time I referred to the > resource, I got a Bus Error exception, because I was following > the invalid handle out into La-La Land. > > Why didn't ResError tell me there was a problem? > > --Kurisuto > un020070@vaxa.wvnet.edu I've seen it documented that ResError doesn't always return 0. I think the preferred method is to check the resource hanfter you read it in. Check for nil. if (myRes = nil) then .... or if (myRes^=nil) then ... I've never been clear which is more reliable, the handle or pointer. john calhoun