Macintosh Pascal 1.0: Error ID=02 on 512K with no external drive

On a 512K Macintosh with no external drive attached and any Finder (1.1, 4.1,
or 5.0), Macintosh Pascal bombs with a system error ID=02 when executing the
following Pascal program:

program Bomb;
var
r : real;
outfile : text;
begin
rewrite(outfile, 'Data Disk:Sample File');
r := 0;
writeln(r : 5 : 2);
writeln(outfile, r : 5 : 2);
end.

Using the step-step feature of Macintosh Pascal, the next line to be executed
when the bomb occurs is "r := );".

To get this error:

1. Insure that the external drive is not connected. The system must have one
drive only.

2. Boot with Macintosh Pascal disk.

3. At the desktop, eject the Macintosh Pascal disk.

4. Insert a blank disk and name it "Data Disk".

5. Eject this disk. Do NOT put it in the trash - the disk must still exist on
the system.

6. Open Pascal document "Bomb", the program above.

7. Execute the program either with the command "go" or "step-step".

8. Insert the disk "Data Disk" when the message asking for it appears.

This problem has two work arounds:

1. Move the statement "r := 0;"
before the statement "rewrite(outfile, 'Data Disk:Sample File');

2. As a general practice, place the File definition var FIRST.
Published Date: Feb 19, 2012