answersLogoWhite

0


Best Answer

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

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you raise declare and handle exception in Ada?
Write your answer...
Submit
Still have questions?
magnify glass
imp