[fpc-pascal] exiting a program more friendly way

Michael Van Canneyt michael at freepascal.org
Fri Jun 23 09:03:05 CEST 2006



On Fri, 23 Jun 2006, Pianoman wrote:

>
> Hi, I'd like to ask whether is it possible to exit program in case of runtime 
> error 202 for example more nicely than with message runtime error 202 at 
> a1d456d5621blablabla
> For example:
> writeln('starting to divide:');
> writeln(2/0);
> and I don't want mi program to stop with runtime error but I 'd like to write 
> to screen something like: writeln('program has atempted to divide by zero 
> enter another expression.');
> old tp had a special procedure exitproc which allowed to set which code 
> should be executed before terminating in case of run-time error. I mean code 
> which will close opened files or something like that or it could write to 
> logfile the reason of error.

FPC has the same exitproc. See the manuals.

Michael.



More information about the fpc-pascal mailing list