[comp.lang.pascal] TP Overlays bug?

rio@tension.me.utoronto.ca (Oscar del Rio) (09/07/90)

Hi guys!

Last year I was writing a big program for my bachelor`s thesis, using TP 4.0.
As the program was growing every day and it was supossed to be used in any PC
(including some with limited memory), I decided to upgrade it to TP 5.0 to
take advantage of the overlay system.

The program consisted of more than 20 units, 300K code size, 40K data size,
30K stack size, 100K heap size (aprox.) and more than 17000 lines of source
code. I didn't have any problem upgrading the program.
I converted more than 10 units to overlay units and it worked well.

One day I copied the program to diskettes and ran it to see how it worked
in machines without hard disk. It worked OK while the disk with the overlay
file was in the drive. I left the door of the drive open to see what hapenned,
and the program aborted with an I/O error message. OK, it isn't so bad; at
least TP reported the error.

But then I decided to change the disk with the overlay file for any other one
expecting another I/O error message when the program tried to read the
overlay file. But it didn't report any error message. Instead, the program
read and executed whatever it found in that disk (garbage, of course) without
checking if the overlay file was still there.

Isn't that a bug? I think it is. 

In order to check that kind of errors, I had to write an interrupt procedure
replacing the INT 21H, that checked if the overlay file was available or not
any time the program tried to read it.

Does anybody know another way to handle this kind of errors without having to
write an interrupt handler? I think TP should provide an easier way; something
like the ErrorAddr pointer to an error handler subroutine (it doesn't work in 
this case).

What about TP 5.5? I saw that there are some new procedures in the overlay
unit (OvrGetRetry and OvrSetRetry). What are they for?

Thanks for your comments.

-- 
Oscar Ivan del Rio                    | rio@tension.me.utoronto.ca
Department of Mechanical Engineering  | rio@me.toronto.edu
University of Toronto                 |
CANADA                                |