Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!buengc!art From: art@buengc.BU.EDU (A. R. Thompson) Newsgroups: comp.lang.pascal Subject: Re: Control variables in FOR loops Message-ID: <1712@buengc.BU.EDU> Date: 18 Dec 88 20:30:41 GMT References: <1439@csuna.UUCP> <169@m2xenix.UUCP> Reply-To: art@buengc.bu.edu (A. R. Thompson) Followup-To: comp.lang.pascal Organization: Boston Univ. Col. of Eng. Lines: 21 In article <169@m2xenix.UUCP> randy@m2xenix.UUCP (Randy Bush) writes: >Conjecture and testing aginst particular implementations (other than ours, of >course:-) may be amusing, but have little to do with the definition of the >language. I recommend the standard itself, accompanied by "Standard Pascal >User Reference Manual" by Doug Cooper. Another goodd reference is "Pascal. User Manual and Report" 3rd ed. Jensen and Wirth, revised by Mickel and Miner. > >The interesting, and unexpected, restriction is that it may not be threatened >by use within an enclosed procedure/function. The following is not legal: > I'm not quite sure what is so "unexpected" in the restriction that there may not be an assigning reference to the control variable in a for statement. The for statement is intended as a strictly sequential way of stepping through a succesion of statements (often array references). If you want to make assigning references to the control variable in a looping statement, you should use either a while statement or a repeat statement. That's what they are for (so to speak).