<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=koi8-r">
<META content="MSHTML 5.50.4207.2601" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>{$I compdefs.inc}<BR>unit Error;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>interface</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>implementation</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>var<BR> ExitAddress : pointer;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>type<BR>PtrRec =
record
// Pointer record type<BR> Ofs: Longint;<BR>
end;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>procedure ErrorExit;<BR> var<BR>
FileName: String;<BR> LineNo: Longint;<BR> begin<BR> if
ErrorAddr<>nil then<BR> if ExitCode<>0 then<BR>
begin<BR> Assign(output,'');<BR>
Rewrite(output);<BR> begin<BR>
WriteLn(output,'Program terminated with specific error
#'+Addspaces(int2str(ExitCode),3,'0',true)+'.');<BR> case
ExitCode of<BR> 1..18 :
Write(output,^G+'DOS ERROR: ');<BR> 100..106 :
Write(output,^G+'I/O ERROR: ');<BR>
150..162,<BR> 200..216 : Write(output,^G+'CRITICAL
ERROR: ');<BR> end;<BR> case ExitCode
of<BR> 001: Writeln(output,'Invalid function
number.');<BR> 002: Writeln(output,'File not
found.');<BR> 003: Writeln(output,'Path not
found.');<BR> 004: Writeln(output,'Too many open
files.');<BR> 005: Writeln(output,'File access
denied.');<BR> 006: Writeln(output,'Invalid file
handle.');<BR> 012: Writeln(output,'Invalid file access
code.');<BR> 015: Writeln(output,'Invalid drive
number.');<BR> 016: Writeln(output,'Cannot remove
current directory.');<BR> 017: Writeln(output,'Cannot
rename across drives.');<BR> 018: Writeln(output,'No
More Files.');<BR> 100: Writeln(output,'Disk read
error.');<BR> 101: Writeln(output,'Disk write
error.');<BR> 102: Writeln(output,'File not
assigned.');<BR> 103: Writeln(output,'File not
open.');<BR> 104: Writeln(output,'File not open for
input.');<BR> 105: Writeln(output,'File not open for
output.');<BR> 106: Writeln(output,'Invalid numeric
format.');<BR> 150: Writeln(output,'Disk is
write-protected.');<BR> 151: Writeln(output,'Unknown
unit.');<BR> 152: Writeln(output,'Drive not
ready.');<BR> 153: Writeln(output,'Unknown
command.');<BR> 154: Writeln(output,'CRC error in
data.');<BR> 155: Writeln(output,'Bad drive request
structure length.');<BR> 156: Writeln(output,'Disk seek
error.');<BR> 157: Writeln(output,'Unknown media
type.');<BR> 158: Writeln(output,'Sector not
found.');<BR> 159: Writeln(output,'Printer out of
paper.');<BR> 160: Writeln(output,'Device write
fault.');<BR> 161: Writeln(output,'Device read
fault.');<BR> 162: Writeln(output,'Hardware
failure.');<BR> 200: Writeln(output,'Division by
zero.');<BR> 201: Writeln(output,'Range check
error.');<BR> 202: Writeln(output,'Stack overflow
error.');<BR> 203: Writeln(output,'Heap overflow
error.');<BR> 204: Writeln(output,'Invalid pointer
operation.');<BR> 205: Writeln(output,'Floating point
overflow.');<BR> 206: Writeln(output,'Floating point
underflow.');<BR> 207: Writeln(output,'Invalid floating
point operation.');<BR> 208: Writeln(output,'Overlay
manager not installed.');<BR> 209:
Writeln(output,'Overlay file read error.');<BR> 210:
Writeln(output,'Object not initialized.');<BR> 211:
Writeln(output,'Call to abstract method.');<BR> 212:
Writeln(output,'Stream registration error.');<BR> 213:
Writeln(output,'Collection index out of range.');<BR>
214: Writeln(output,'Collection overflow error.');<BR>
215: Writeln(output,'Arithmetic overflow error.');<BR>
216: Writeln(output,'General Protection fault.');<BR>
else WriteLn(output,^G+'Unknown Error.');<BR>
end;<BR> if
GetLocationInfo(ErrorAddr,FileName,LineNo)<>nil<BR> then
writeLn(output,'Exception in '+filename+'#'+int2str(lineno-1));</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> if exitcode in
[150..162,200..216] then Writeln(output,^G+'Please send message to
author!');<BR> ErrorAddr:=nil;<BR>
ExitCode:=0;<BR> Close(output);<BR> end;<BR>
end;<BR> ExitProc:=ExitAddress;<BR> end;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>begin<BR> ExitAddress:=ExitProc;<BR>
ExitProc:=@ErrorExit;<BR>end.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This version for VP, but may be use with any
BP-like compiler. Fully worked source.</FONT></DIV></BODY></HTML>