Hello PGD users.

When I Has making my Map Editor i encoutred a really strange error on my MapEd the map can't be opened
It appears a message showing : '' is not a valid integer value can anyone help me with this?


Here is the code for opening and Saving and The program


Opening:
Code:
procedure TForm1.Button5Click(Sender: TObject);
var
Arquivo : TextFile;
X, Y : Integer;
Temp: String;
begin
if OpenDialog1.Execute then
 begin
  AssignFile(Arquivo,OpenDialog1.FileName);
  Reset(Arquivo);
   for X:= 0 to 9 do
    begin
      ReadLn(Arquivo, Temp);
      for Y := 0 to 9 do
        Area[Y, X] := StrToInt(Copy(Temp, Y + 1, 1))
    end;
    CloseFile(Arquivo);
    DrawGrid1.Refresh;
  end;
end;
For Saving
Code:
procedure TForm1.Button4Click(Sender: TObject);
var
 Arquivo : TextFile;
 X,Y : Integer;
 S : string;
begin
 if SaveDialog1.Execute then
  begin
   AssignFile(Arquivo,SaveDialog1.FileName);
   Rewrite(Arquivo);
    for X:= 0 to 9 do
    begin
     for Y:= 0 to 9 do
      S:= S + IntToStr(Area[Y,X]);
     WriteLn(Arquivo,S);
     S:='';
   end;
   CloseFile(Arquivo);
end;
end;
Can anyone help me with this ?
THX

mongoixp