Newsgroups: comp.lang.pascal Path: utzoo!utgpu!watserv1!watmath!nmouawad From: nmouawad@watmath.waterloo.edu (Naji Mouawad) Subject: Re: DYNIX Pascal compiler Message-ID: <1991Feb18.033658.26497@watmath.waterloo.edu> Keywords: compiler Organization: University of Waterloo References: Date: Mon, 18 Feb 1991 03:36:58 GMT Lines: 31 In article 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?' > >This is the DYNIX Pascal compiler on the UNIX >system. This error has me baffled.. Thanks. > >Jerry Duffy >mtbb114@s.ms.uky.edu This is a Standard Pascal Error: you cannot use a parameter to a procedure or a function as a control variable within a for loop. That is: procedure Notsogood(var i : integer); begin For i := 1 to 5 do writeln('this will give error 172, tidlidoo'); end; I am not sure wether using a global variable is allowed, although I suspect that this may be allowed. --Naji -- ------------------------------------------------------------------- | Naji Mouawad | nmouawad@watmath.waterloo.edu | | University |---------------------------------------------------| | Of Waterloo | "The Stranger in us is our most familiar Self" |