Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!newcastle.ac.uk!turing!n01qu From: A.G.Poole@newcastle.ac.uk (Ford (Alex Poole)) Newsgroups: comp.lang.pascal Subject: Re: DYNIX Pascal compiler Keywords: compiler Message-ID: <1991Feb19.141528.23310@newcastle.ac.uk> Date: 19 Feb 91 14:15:28 GMT References: Sender: news@newcastle.ac.uk Organization: University of Newcastle upon Tyne, UK, NE1 7RU Lines: 36 mtbb114@ms.uky.edu (Jerry Duffy) writes: >This maybe a stupid question, but does anyone >know what it means when it gives the error >number 172 'Control variable of a for statement >must be local?' The problem is probably in a function or procedure; you have to define the variable being used in the FOR loop within the procedure, even if it normally exists as a global. eg PROGRAM blah (etc.); VAR i:INTEGER; PROCEDURE loop; VAR i:INTEGER; BEGIN FOR i:=1 TO 1 DO writeln END; BEGIN loop END. As it stands, you'll get a 'variable i declared but not used' message instead, as its defined globally but only used locally. Hope that helps!! Ford ----- I come from a good home - thats why they don't want me back.