[fpc-pascal]error messages

peter at freepascal.org peter at freepascal.org
Tue Sep 19 14:34:55 CEST 2000


> procedure ErrorMessage;
> begin
>   if ErrorAddr <> nil then
>     begin
>       case ExitCode of
>         1: writeln ('Invalid function number.');
<cut>

>         227: writeln ('Assertion failed error.');
>         else writeln ('Unknown error.');
>       end;
>     end;
>   Exitproc:=OldExitProc;
> end;

Small hint: place the ExitProc:=OldExitProc as the first statement in the 
procedure. If not done and your procedure gives an error it'll get into an 
infinite loop.






More information about the fpc-pascal mailing list