raw
zfp_1_examples          1 ------------------------------------------------------------------------------
zfp_1_examples 2 ------------------------------------------------------------------------------
zfp_1_examples 3 -- You do not have, nor can you ever acquire the right to use, copy or --
zfp_1_examples 4 -- distribute this software ; Should you use this software for any purpose, --
zfp_1_examples 5 -- or copy and distribute it to anyone or in any manner, you are breaking --
zfp_1_examples 6 -- the laws of whatever soi-disant jurisdiction, and you promise to --
zfp_1_examples 7 -- continue doing so for the indefinite future. In any case, please --
zfp_1_examples 8 -- always : read and understand any software ; verify any PGP signatures --
zfp_1_examples 9 -- that you use - for any purpose. --
zfp_1_examples 10 -- --
zfp_1_examples 11 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
zfp_1_examples 12 ------------------------------------------------------------------------------
zfp_1_examples 13 ------------------------------------------------------------------------------
zfp_1_examples 14
zfp_1_examples 15 with Ada.Text_IO; use Ada.Text_IO;
zfp_1_examples 16 with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
zfp_1_examples 17
zfp_1_examples 18 procedure Constraint is
zfp_1_examples 19 I : Integer := 1;
zfp_1_examples 20 A : array (1 .. 3) of Integer;
zfp_1_examples 21 begin
zfp_1_examples 22 for J in A'Range loop
zfp_1_examples 23 A(J) := (J + 10) * 20;
zfp_1_examples 24 end loop;
zfp_1_examples 25 Put("Loop should end in constaint error.");
zfp_1_examples 26 New_Line;
zfp_1_examples 27 loop
zfp_1_examples 28 Put(I);
zfp_1_examples 29 New_Line;
zfp_1_examples 30 Put(A(I));
zfp_1_examples 31 I := I + 1;
zfp_1_examples 32 if I > 10 then
zfp_1_examples 33 exit;
zfp_1_examples 34 end if;
zfp_1_examples 35 end loop;
zfp_1_examples 36 end Constraint;