home *** CD-ROM | disk | FTP | other *** search
- unit Xception; { Exception handling via CATCH and THROW }
-
- {$D+}
-
- interface
-
- type
- Target = record
- Private: array[1..10] of byte; { "Abstract data type" }
- Point: pointer; { The THROWing point }
- end;
- ExceptionMode =
- (ExceptionSet, ExceptionUsed);
-
- function Catch(var Exception: Target): ExceptionMode;
-
- procedure Throw(var Exception: Target);
-
- function CanonicThrowingPoint(var Exception: Target): pointer;
-
- implementation
-
- {$L Xception.obj }
-
- function Catch(var Exception: Target): ExceptionMode; external;
-
- procedure Throw(var Exception: Target); external;
-
- function CanonicThrowingPoint(var Exception: Target): pointer;
- type
- DWord = record
- Lo, Hi: word;
- end;
- begin
- Dec(DWord(Exception.Point).Hi, PrefixSeg + $10);
- CanonicThrowingPoint := Exception.Point;
- end;
-
- end.
-