Xref: utzoo comp.lang.pascal:2827 alt.msdos.programmer:891 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!jarthur!uci-ics!gateway From: milne@ICS.UCI.EDU (Alastair Milne) Newsgroups: comp.lang.pascal,alt.msdos.programmer Subject: exiting some calling ancestor in Turbo Pascal 5 Message-ID: <8912141752.aa23459@ICS.UCI.EDU> Date: 15 Dec 89 01:58:03 GMT Lines: 26 To: alt.msdos.programmer@ICS.UCI.EDU cc: comp.lang.pascal@ICS.UCI.EDU Our project is moving a number of its CAI programs from UCSD Pascal (under the p-System, of course) to Turbo Pascal 5.0. Though it has gone much more smoothly overall than one might have expected, a few hard problems keep coming up. A couple have already been addressed by some people on this group, so I have some hope for this one: UCSD Pascal defines the call "EXIT(procedure-name);", where procedure-name must be one of the procedures currently running -- that is, it must have a stack-frame currently allocated somewhere up the call stack. EXIT exits the local procedure and every calling procedure until it reaches and exits "procedure-name". Each procedure exited first has its "termination code" executed, which usually is either empty or makes sure any local files are properly closed. This means that, in exceptional situations, major chunks of code can be exited at the option of local routines, without actually halting the whole program. Turbo Pascal gives only, as far as I know, EXIT (which exits the immediate block, but nothing further) and HALT (which kills the whole program). Does anybody know of a way in Turbo Pascal to obtain the effect of UCSD Pascal's EXIT? Alastair Milne, Programming Manager, Educational Techology Center