home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xco212p.zip / ISODEF / exceptio.def < prev    next >
Text File  |  1994-12-22  |  2KB  |  44 lines

  1. DEFINITION MODULE EXCEPTIONS;
  2.  
  3. (* Provides facilities for raising user exceptions
  4.    and for making enquiries concerning the current execution state.
  5. *)
  6.  
  7. TYPE
  8.   ExceptionSource;                (* values of this type are used within library modules to 
  9.                                      identify the source of raised exceptions    *)
  10.   ExceptionNumber = CARDINAL;
  11.  
  12. PROCEDURE AllocateSource(VAR newSource: ExceptionSource);
  13.   (* Allocates a unique value of type ExceptionSource *)
  14.  
  15. PROCEDURE RAISE (source: ExceptionSource; number: ExceptionNumber; message: ARRAY OF CHAR);
  16.   (* Associates the given values of source, number and message with the current context 
  17.      and raises an exception.
  18.   *)
  19.  
  20. PROCEDURE CurrentNumber (source: ExceptionSource): ExceptionNumber;
  21.   (* If the current coroutine is in the exceptional execution state because of the raising
  22.      of an exception from source, returns the corresponding number, and otherwise
  23.      raises an exception.
  24.   *)
  25.  
  26. PROCEDURE GetMessage (VAR text: ARRAY OF CHAR);
  27.   (* If the current coroutine is in the exceptional execution state, returns the possibly 
  28.      truncated string associated with the current context.
  29.      Otherwise, in normal execution state, returns the empty string.
  30.   *)
  31.  
  32. PROCEDURE IsCurrentSource (source: ExceptionSource): BOOLEAN;
  33.   (* If the current coroutine is in the exceptional execution state because of the raising
  34.      of an exception from source, returns TRUE, and otherwise returns FALSE.
  35.   *)
  36.  
  37. PROCEDURE IsExceptionalExecution (): BOOLEAN;
  38.   (* If the current coroutine is in the exceptional execution state because of the raising
  39.      of an exception, returns TRUE, and otherwise returns FALSE.
  40.   *)
  41.  
  42. END EXCEPTIONS.
  43.  
  44.