Try this:
--
-- This pragma allows exceptions to be handled by routines or by
-- the catch all Last_Chance_Hander.
--
pragma Restrictions ( No_Exception_Registration ) ;
--
-- These pragmas stops exceptions on many fronts.
--
-- pragma Restrictions ( No_Exceptions ) ;
-- pragma Restrictions ( No_Exception_Handlers ) ;
-- pragma Restrictions ( No_Exception_Propagation ) ;
----------------------------------------------------------------------
-- Last_Chance_Handler: Displays a Exception Termination Message. --
-- Shutdowns run-time-system. --
-- Halts processor. --
----------------------------------------------------------------------
-----------------------------------------------------------------
-- compile/bind/link with "--RTS=x86" for x86 Bare Bones --
-- Run-Time System. --
-----------------------------------------------------------------
with Ada.Characters.Latin_1 ; -- for ESC character
-- with Ada.Text_IO ; -- Must have full exception
-- working to use
with System ;
with System.IO ;
procedure Teste is
use Ada.Characters.Latin_1 ;
-- use Ada.Text_IO ;
use System ;
use IO ;
Hello_Error : exception ;
begin
--
-- Clear Screen and Display Title message using
-- VT100 / VT52 ANSI escape sequences
--
-- Works on most OSs including Linux.
--
Put ( ESC & "[2J" ) ; -- clear screen
Put ( ESC & "[12;30H" ) ; -- set screen location
Put ( ESC & "[31;40;01m" ) ; -- set text color to Red/Black
Put ( "Bare Bone: " ) ;
Put ( ESC & "[37;40;00m" ) ; -- reset color
Put_Line ( "Hello" ) ;
New_Line ;
--
-- Without a Exception handler the following will cause
-- the last chance handler to be executed, directly.
--
raise Hello_Error ;
-- raise Program_Error ;
-- Exception Handler:
--
-- The first two handlers will raise another exception that
-- will be handled by the Last_Chance_Handler.
--
-- The third handler will not propagate the exception.
-- In turn, the Last_Chance_Hander will not be executed.
--
--
exception
--
when Hello_Error =>
Put_Line ( "Exception Error: Hello" ) ;
raise ;
--
when Program_Error =>
Put_Line ( "Exception Error: Program" ) ;
raise ;
--
when others =>
Put_Line ( "Exception Error: All Others" ) ;
end Teste ;
Lucretia <
lague...@googlemail.com> wrote in
news:1ca9d254-a12a-4ec3...@googlegroups.com: