Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!quiche!einstein From: einstein@cs.mcgill.ca (Michael CHOWET) Newsgroups: comp.lang.pascal Subject: Re: IMPLEMENT "GOTO" ACROSS MODULES IN TURBO PASCAL?? Message-ID: <1991Jan9.160520.7109@cs.mcgill.ca> Date: 9 Jan 91 16:05:20 GMT References: <11647@j.cc.purdue.edu> Sender: news@cs.mcgill.ca (Netnews Administrator) Organization: SOCS, McGill University, Montreal, Canada Lines: 39 In article <11647@j.cc.purdue.edu> you write: >Here is the problem: > Suppose there is such a structure in the main part of the program: > > repeat > statemetn 1 > statement 2 > . > . > . > statement n > until whatever > > Now I need to write a subroutine to point the program to statement n. >It seems there is no way to do it in turbo pascal, since goto statement >can not go out of a subroutine. > Any clue? Well, not to criticize or anything, but if you're trying to do what I think you're trying to do, don't. If all you want is to stay inside your repeat, fine. If you want to enter your repeat from some line above it, IN THE SAME MODULE and such that it doesn't exit any loops before they naturally terminate, fine. If you want, however, to jump across modules or exit loops prematurely, then you've missed the whole point of Pascal, and structured programming. If indeed this *IS* what you want to do, then either restructure your program to avoid this odd state of affairs, or take up Basic. ============================================================================== Today's message was brought to you by the letter 'S', the number 6, and =====> Einstein@cs.mcgill.ca <==== =====> Mike CHOWET | McGill CSUS VP External <===== Post back soon, now y'hear... ==============================================================================