Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!pasteur!ames!ucsd!ucsdhub!hp-sdd!ncr-sd!ncrlnk!uunet!tektronix!percival!parsely!agora!ihf1!bobd From: bobd@ihf1.UUCP (Bob Dietrich) Newsgroups: comp.lang.pascal Subject: Re: Re^2: Control variables in FOR Message-ID: <518@ihf1.UUCP> Date: 10 Feb 89 18:19:12 GMT References: <950015@hpcllmr.hp.com> <134300002@cdp> Reply-To: bobd@ihf1.UUCP (Bob Dietrich) Organization: Intel Corp., Hillsboro, Oregon Lines: 21 In article <134300002@cdp> ipis@cdp.UUCP writes: > >I've had the same problem with INVALID CONTROL VARIABLE using HP >Pascal on the Hp3000 at school. I think it doesn't follow along the >scope rules for standard pascal. If you declare I as local to the >procedure, it works. >--andy Perrin Sorry, but HP3000 Pascal is correct in this regard. The control variable for a for-statement must be declared local to the block of the procedure, function, or program closest containing the for-statement. There are many compilers that predate the Pascal standard, and therefore do not enforce this restriction. Sometimes it's because no one has bought an updated compiler; sometimes it's because the vendor hasn't issued an update; and sometimes it's because the vendor shows no intention of conforming to standards (like Borland and Turbo Pascal). usenet: uunet!littlei!intelhf!ihf1!bobd Bob Dietrich or tektronix!ogccse!omepd!ihf1!bobd Intel Corp., Hillsboro, Oregon or tektronix!psu-cs!omepd!ihf1!bobd (503) 696-2092