So last night I had my last Pascal Class and Monday is the FINAL! I lost my book a month ago and finally got a new one 2 days ago and I am playing catchup.
By Monday I need to have read up on and understand
1. Arrays
2. Multi Dimensional Arrays
3. Records (which sounds like C Structs)
Each of these I get by there own for the most part. But combining them I get lost. Example, passing an ARRAY of RECORDS as a PARAMETER to a PROCEDURE
I was slowly working on some code and compiling as I went along and then hit a snag. I am getting a error in the PROCEDURE on this line Studentcard.idno := 3345; . I am trying to assign that integer value 3345 to the record being stored in that array. I must be over looking something obvious.
Any help is appreciated
-Lars
By Monday I need to have read up on and understand
1. Arrays
2. Multi Dimensional Arrays
3. Records (which sounds like C Structs)
Each of these I get by there own for the most part. But combining them I get lost. Example, passing an ARRAY of RECORDS as a PARAMETER to a PROCEDURE
I was slowly working on some code and compiling as I went along and then hit a snag. I am getting a error in the PROCEDURE on this line Studentcard.idno := 3345; . I am trying to assign that integer value 3345 to the record being stored in that array. I must be over looking something obvious.
Code:
program procpass;
const
numOfRecords = 30;
type
numOfRecordes = 1..30;
student = record
name : char;
major : integer;
classtpe : integer;
idno : integer;
end;
oneRecord = array[numOfRecordes] of student;
var
studentcard : oneRecord;
procedure inputdata(studentcard : oneRecord);
var
i : integer;
begin
for i := 1 to 30 DO
Studentcard.idno[i] := 3345;
end;
begin
inputdata(studentcard);
end.
Any help is appreciated
-Lars