Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!samsung!cs.utexas.edu!yale!mintaka!ogicse!plains!puklich From: puklich@plains.UUCP (Blayne Puklich) Newsgroups: comp.sys.mac.programmer Subject: Re: Breaking out of a series of routines Message-ID: <5252@plains.UUCP> Date: 9 Jul 90 18:13:24 GMT References: <25526@cs.yale.edu> Organization: North Dakota State University, Fargo Lines: 24 tarr-michael@CS.Yale.EDU (michael tarr) wrote in article Breaking out of a series of routines: >On an error condition I wish to immediately stop processing a large file >and break out of about 10 routines that have been calling each other and >return to my main event loop. Is there any way to do this without >passing and error flag to each of the calling routines? You can use the setjmp() and longjmp() pair of functions to do this, assuming you're using C. I'm not very familiar with these, but with a bit of experimentation and manual reading, you should be able to figure out how to use these functions. If you're using Pascal, probably a good way to do this is to pass a return code back up through each function (make them functions). Then each and every call to the functions would be a test for a return code. This really isn't as painful as it may seem like. Pascal function return values are generally placed in a register (D0 if I remember right), so a test wouldn't be too time-consuming. ||+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++|| || Blayne Puklich puklich@Plains.NoDak.EDU "I think I'm going bald..." || || NDSU, Fargo, ND (701) 237-4408 -- Rush, Caress of Steel, || || 1975 || ||-------------------------------------------------------------------------||