All pastes #898809 Raw Edit

Anonym

public text v1 · immutable
·published 2008-02-10 17:04 UTC
rendered paste body
with Ada.Text_IO;

procedure ArrayTest is
        type Index_Type is new Positive;
        package Index_IO is new Ada.Text_IO.Integer_IO (Index_Type);
        type Element_Type is new Natural;
        type My_Array_Type is array (Index_Type range <>) of Element_Type;
        type My_Array_Access is access My_Array_Type;

        My_Index : Index_Type;
        My_Array : My_Array_Access;
begin
        Ada.Text_IO.Put ("Please enter maximum Index: ");
        Index_IO.Get (My_Index);
        My_Array := new My_Array_Type (1..My_Index);
        -- work with My_Array...
end ArrayTest;