bug
Toby Ewing
ewing at iastate.edu
Wed Apr 26 19:48:52 CEST 2000
Hi, all.
I've been fighting a bug for a while, and when I stripped it down to its
basics, I was surprised. My test program is appended.
The issue involves arrays of size > 255. When I use Ymax = Zmax = 250,
the program runs fine. When I use Ymax = Zmax = 260, the portion of the
program that runs in Main works fine, but the procedure stops at y = 7,
z = 260 - the program hangs, with ^C ineffective.
I'm running a pentium 400 under Win98. I've had no trouble with this in
small arrays, but 256 seems to be a divide of some sort.
Any suggestions appreciated.
Toby
Toby Ewing
Soil Scientist, Iowa State University
-------------------------------------------------------------------
Program TestLgArray;
Const
Xmax = 25 ; {physical space - grid units}
Ymax = 260; {physical space - grid units}
Zmax = 260;
Type
Compary = array[1..Ymax, 1..Zmax] of integer;
var
Comp : Compary;
x, y, z : integer;
{________________________________________________
}
Procedure Zero;
var
Comp : Compary;
x, y, z : integer;
begin
writeln('Procedure:');
readln;
for y := 1 to Ymax do begin {zero the comp array}
for z := 1 to Zmax do Comp[y,z] := 0;
writeln('y=', y:3, ' z=', z:1);
end;
end;
{________________________________________________
}
begin {Main Program}
writeln('Main:');
readln;
for y := 1 to Ymax do begin {zero the comp array}
for z := 1 to Zmax do Comp[y,z] := 0;
writeln('y=', y:3, ' z=', z:1);
end;
Zero;
write(' done');
end.
More information about the Gpc
mailing list