-- {{Ada/Sourceforge|convert_checked.adb}}
pragma License (Gpl);
pragma Ada_95;
with Ada.Text_IO;
procedure Convert_Checked is
type Short is range -128 .. +127;
type Byte is mod 256;
package T_IO renames Ada.Text_IO;
package M_IO is new Ada.Text_IO.Modular_IO (Byte);
A : constant Short := -1;
B : Byte;
begin
B := Byte (A);
T_IO.Put ("B = ");
M_IO.Put (Item => B, Width => 5, Base => 10);
end Convert_Checked;
----------------------------------------------------------------------------
-- $Author$
--
-- $Revision$
-- $Date$
--
-- $Id$
-- $HeadURL$
----------------------------------------------------------------------------
-- vim: textwidth=0 nowrap tabstop=8 shiftwidth=3 softtabstop=3 expandtab
-- vim: filetype=ada encoding=utf-8 fileformat=unix foldmethod=indent