.comment-link {margin-left:.6em;}

Thursday, August 30, 2007

 

free pascal runtime error

I am getting a runtime error with this
record = point
x : integer;
y: integer;

procedure drawroom(offx,offy:integer; room : point);
var
x : integer;
y : integer;
xx,yy : integer;
begin
x := offx + room.x;
y := offy + room.y;
for xx := offx to x do;
for yy := offy to y do;
level[xx],[yy] := ' ';
end;

and when I call drawroom

Eaccessviolation

Labels:


Comments:
you need to remove the semi colons after the two "for" statements, otherwise the "for" statements just do nothing. you also have a syntax error when accessing the 2d array:

for xx := offx to x do
for yy := offy to y do
level[xx,yy] := ' ';

hth
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?