Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Breaking out of a series of routines Message-ID: <42856@apple.Apple.COM> Date: 11 Jul 90 13:24:26 GMT References: <25526@cs.yale.edu> Organization: Apple Computer Inc, Cupertino, CA Lines: 20 In article <25526@cs.yale.edu> tarr-michael@CS.Yale.EDU (michael tarr) writes: > >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? As Blayne noted, if you are programming in C, you can use setjmp/longjmp. If you are using MacApp, then you can use the UFailure routines, CatchFailures and Success. Both of these mechanisms are subsets of the extensive Signals unit in DTS Sample Code #12. Those routines can be used from both C and Pascal, and full source code is provided. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions