Download Entire Book as a Single PDF Document

Transcript
HLA Reference Manual
5/24/10
Chapter 14
ex.IllegalInstr
ex.BoundInstr
ex.IntoInstr
ex.DivideError
ex.fDenormal
ex.fDivByZero
ex.fInexactResult
ex.fInvalidOperation
ex.fOverflow
ex.fStackCheck
ex.fUnderflow
ex.InvalidHandle
ex.StackOverflow
ex.ControlC
This list is constantly changing as the HLA Standard Library grows, so it is impossible to
provide a compete list of standard exceptions at this time. Please see the excepts.hhf header file for
a complete list of standard exceptions. As this was being written, the *NIX-specific exceptions
(signals) had not been added to the list. See the excepts.hhf file on your *NIX system to see if these
have been added. Note that not all OSes support every hardware-related exception value.
The HLA Standard Library currently reserves exception numbers zero through 1023 for its
own internal use. User-defined exceptions should use an integer value greater than or equal to 1024
and less than or equal to 65535 ($FFFF). Exception value $10000 and above are reserved for use
by Windows Structured Exception Handler and *NIX signals.
The TRY..ENDTRY statement contains two or more blocks of statements. The statements to
protect immediately follow the TRY reserved word. During the execution of the protected
statements, if the program encounters the first exception block, control immediately transfers to the
first statement following the endtry reserved word. The program will skip all the statements in the
exception blocks.
If an exception occurs during the execution of the protected block, control is immediate
transferred to an exception handling block that begins with the exception reserved word and the
constant that specifies the type of exception.
Example:
repeat
mov( false, GoodInput );
try
stdout.put( "Enter an integer value:" );
stdin.get( i );
mov( true, GoodInput );
exception( ex.ValueOutOfRange )
stdout.put( "Numeric overflow, please reenter ", nl );
exception( ex.ConversionError )
stdout.put( "Conversion error, please reenter", nl );
Public Domain
Created by Randy Hyde
Page 323