with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Ada.Text_IO; use Ada.Text_IO; procedure tryArrays is a: array (-2 .. 1) of Integer; -- Not initialized type color is (red, blue, green, orange); b: array(blue .. orange) of Float; package Color_IO is new Enumeration_IO(Color); use Color_IO; begin for i in -2 .. 1 loop a(i) := 2 * i; end loop; new_line; for i in a'range loop put(i); put(a(i)); new_line; end loop; new_line; b(blue) := 1.1; put(b(blue)); put(b'length); new_line; for c in red .. orange loop -- for c in b'first .. b'last loop -- for c in b'range loop b(c) := float(Color'Pos(c)) * 2.0; put(c, 8); put(Color'Pos(c)); put(b(c), 4, 0, 0); new_line; end loop; end tryArrays; -- SAMPLE RUN -2 -4 -1 -2 0 0 1 2 3 BLUE 1 2.0 GREEN 2 4.0 ORANGE 3 6.0