GOTO is an old style of programming, and should be avoided if possible, instead use otherconsturctions like procedures or functions.
Remember in FreePascal the old Turbo Pascal way of handling with files have been replaced so:
Assign now is AssignFile
Close is CloseFile
What for type is file1? Try by using file1:text;
Try this:
var
f:text;
ch:char;
begin
assignfile(f,'test.txt');
reset(f);
while not eof(f) do
begin
read(f,ch);
write(ch);
end;
closefile(f);
readln;
end.
I leave it to you to write the exceptions, and so on....