Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!yale!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Breaking out of a series of routines Message-ID: <14021@unix.SRI.COM> Date: 10 Jul 90 16:15:38 GMT References: <25526@cs.yale.edu> <5252@plains.UUCP> <2745.2699a0d0@cc.helsinki.fi> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 38 In article <2745.2699a0d0@cc.helsinki.fi> mnykanen@cc.helsinki.fi writes: >In article <5252@plains.UUCP>, puklich@plains.UUCP (Blayne Puklich) writes: >> 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? >.stuff on C's set/longjmp() deleted.. [more stuff deleted] >In Pascal a GOTO (yuck!) should suffice, at least as defined in the >standard. Since a Pascal GOTO is *not* just a branch instruction (it >even manages the run-time stack frames!) many microcomputer compilers do >not conform, though. But I too recommend functions returning error codes I might be wrong but I think Apple has come up with something to do this already. Its called Signals. (and I know Apple probably didn't come up with it, maybe its from the unix world) Macintosh Technical Notes #88 describes the signals mechanism. I havn't used or studied it very much but it might be what you need. >Matti Nyk{nen -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________