PROGRAM showArray (input, output); TYPE anArray = array [1..5] of real; (* types need to be declared before vars *) (* Pascal lets you specify lower and upper bounds *) (* array indexes are surrounded by square brackets *) VAR myArray : anArray; counter : integer; myReal : real; PROCEDURE fillArray ( VAR someArray : anArray ; (* someArray is passed by reference (i.e. address) *) someReal : real; (* someReal and size are passed by value (i.e. they are copies ) *) size : integer); VAR counter : integer; (* although it has the same name as a main program variable it is local to this procedure *) BEGIN for counter := 1 to size do someArray[counter] := 2* counter * someReal; writeln (' on exit from the for loop 1 to 5, counter is ', counter); END; BEGIN myReal := 8.23; fillArray(myArray, myReal, 5); (* call to a procedure to fill the array.*) FOR counter := 1 to 5 DO writeln ('*',myArray[counter]:6:2,'*'); END.