answersLogoWhite

0

Exceptions in ADA are declared much like any other variable before the begin statement of a procedure. When raised they excecute the code that is written between the EXCEPTION and END *PROCEDURENAME* lines.

Example as follows:

PROCEDURE Foo IS

FirstException : Exception;

A : Integer := 1;

BEGIN

IF A = 1 THEN

RAISE FirstException;

END IF;

Put("This won't be executed until after the "woopdeedoo" because of the exception");

EXCEPTION

WHEN FirstException =>

Put("Woopdeedoo");

END Foo;

User Avatar

Wiki User

12y ago

What else can I help you with?