Used within a Try...Catch...Finally...End Try series of statements to mark the start of the block of instructions executed when an exception occurs.
Catchexception_object
Prerequisites
Must always follow a Try statement block. Either a Catch or Finally statement or one of each must appear in a Try structure.
Parameters
exception_object
Required Exception Object. The exception_object must already have a data section allocated prior to the execution of this instruction, i.e. the New qualifier should have been previously used in a Dim statement to instantiate the Object.
Remarks
The Catch statement marks the start of the block of instructions that is executed if an exception occurs during the execution of the corresponding Try block of instructions. If the Catch block is triggered, the information on the execution exception is automatically stored into the exception_object.
If an exception occurs during the execution of the Catch block of statements, thread execution will be terminated unless the violating instructions are themselves contained within a Try structure or if a higher-level Try structure exists.
At the completion of the Catch block, the statements in the following Finally block are executed if they exist, otherwise execution continues at the first step following the associated End Try. See the documentation on the Try...Catch...Finally...End Try Statements for further information.
See Also
Exception Handling | Try...Catch...Finally...End Try Statements