Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read matrix write matrix in pascal read runtime error!!!

Status
Not open for further replies.

anthony68

Programmer
Sep 6, 2007
11
NL
program matrix (y);
uses wincrt;

const ad=7;
aw=12;

type
dayindex = 1..ad;
weekindex= 1..aw;
oa = array [weekindex,dayindex] of Integer;

var
y: file of integer;
w: Integer;
o: oa;
r: weekindex;
c: dayindex;


begin
{fill matrix }
assign(y,'y');
reset(y);
for r := 1 to aw do
for c := 1 to ad do
read(y, o[r,c]);
{write results}
writeln('y:');
for r:=1 to 12 do
begin
w:= 0;
for c := 1 to 7 do
w:=r;
writeln('rij',r,'resultaat',w);
end;

end.
 
{something goes wrong in this bit of the program i get een error}
assign(y,'y');
reset(y);
for r := 1 to aw do
for c := 1 to ad do
read(y, o[r,c]);
{i do not know what wrong here...}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top