Tim McGuire <
mcgui...@yahoo.com> writes:
> Procedure Token_Test is
> begin
> declare
> Token : Test_Lock_Token.Lock_Token;
> begin
> Ada.Text_Io.Put_Line ("Got Token");
> declare
> Token_2 : Test_Lock_Token.Lock_Token;
> begin
> Ada.Text_Io.Put_Line ("Got Token_2");
> exception
> When Errors : Test_Lock_Token.Lock_Timeout_Exception =>
> Ada.Text_Io.Put_Line ("Token_2 timed out!");
> end;
> exception
> When Errors : Test_Lock_Token.Lock_Timeout_Exception =>
> Ada.Text_Io.Put_Line("Token timed out!");
> end;
> end Token_Test
Your code is full of syntax errors, so obviously this isn't
the code you ran.
But anyway, I think your exception handlers are confused. An exception
handler in a block does not handle exceptions raise in the "declare"
part of the same block. Ada's syntax is confusing in that regard -- it
LOOKS like they are handled. This is something Java (for example)
gets right. Exception handlers shouldn't be syntactically part
of blocks, procedure bodies, etc -- they should have a separate
statement.
- Bob