Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!jipping@frodo.cs.hope.EDU From: jipping@frodo.cs.hope.EDU (Mike Jipping) Newsgroups: comp.lang.pascal Subject: Re: Loops Message-ID: <12943@brl-adm.ARPA> Date: 13 Apr 88 03:42:01 GMT Sender: news@brl-adm.ARPA Lines: 22 In responding about for loops and scope of control variables, Ralf.Brown@b.gp.cs.cmu.edu writes: > 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. Here's a "what-do-you-folks-think" question: Borland obviously implemented for loops this way to get around the changing-the-control-variable problem. I think it's dumb -- at best, a crummy way to implement the loop, and a nice way to trip up users. It uses implicit declaration -- something found in FORTRAN (gasp) and some BASICs (argh). Ada uses the same scheme for the FOR loop. Fortunately, Borland went back to the ol' real-live-declared control variable approach in Turbo 4.0. -- Mike Mike Jipping Hope College Department of Computer Science jipping@cs.hope.edu