[fpc-pascal] System.Write broken?

John Coppens john at jcoppens.com
Thu Jul 14 00:50:40 CEST 2005


On Wed, 13 Jul 2005 16:50:03 -0500
Elio Cuevas Gómez <elio at mixtk.com> wrote:


> The code to read the file looks like this (yeah, bad programming i
> know): for j := 0 to MAX_MAPY do
>     for i := 0 to MAX_MAPX do
>       Read(MapFile, Mapa[i, j]);
>

How is Mapa declared? If as integers, it should work. This does not work
with strings.

It'd be a little more elegant if you do:

for j := 0 to MAX_MAPY do begin
  for i := 0 to MAX_MAPX do
    Read(MapFile, Mapa[i, j]);
  ReadLn(MapFile);
end;

garanteeing you read MAX_MAPY lines

John




More information about the fpc-pascal mailing list