Xref: utzoo comp.lang.misc:1414 comp.lang.pascal:785 Path: utzoo!mnetor!uunet!amdahl!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!bbn!rochester!PT.CS.CMU.EDU!B.GP.CS.CMU.EDU!Ralf.Brown@B.GP.CS.CMU.EDU From: Ralf.Brown@B.GP.CS.CMU.EDU Newsgroups: comp.lang.misc,comp.lang.pascal Subject: Re: Loops Message-ID: <225cd329@ralf> Date: 8 Apr 88 12:18:33 GMT Sender: netnews@PT.CS.CMU.EDU Lines: 21 Summary: Turbo Pascal uses hidden loop counters for security In-Reply-To: <11047@shemp.CS.UCLA.EDU> In article <11047@shemp.CS.UCLA.EDU>, gast@lanai.cs.ucla.edu (David Gast) writes: }While it is commonly believed that it is impossible to change the }index variable in a for loop, it is possible to do so. Consider the }following program. } [code deleted for brevity] } }David Gast }gast@cs.ucla.edu }{ucbvax,rutgers}!ucla-cs!gast I don't know about Turbo Pascal 4.0, but versions 1 through 3 use a "hidden" variable for the loop counter, so you can change the visible loop counter to your heart's content and the loop will still execute exactly the same number of times. -- {harvard,ucbvax}!b.gp.cs.cmu.edu!ralf -=-=- DISCLAIMER? I claimed something? ARPA: RALF@CS.CMU.EDU FIDO: Ralf Brown 1:129/31 BIT: RALF%CS.CMU.EDU@CMUCCVMA TalkNet: (school) | "Tolerance means excusing the mistakes others make. (412)268-3053 | Tact means not noticing them." --Arthur Schnitzler