All pastes #246442 Raw Edit

Mine

public text v1 · immutable
#246442 ·published 2006-11-12 05:39 UTC
rendered paste body
procedure Find_Bounds ( Sieve : in Primes; Low : in out Integer; High : in out Integer ) is
                use Ada.Text_IO;
                use Ada.Integer_Text_IO;
begin
                loop
                     Put("Upper Bound: ");
                     Get(High);
                     exit when High > 0 or then High <= Sieve'Last;
                     New_Line;
                     Put_Line(Integer'Image(High) & " must be between 0 and " & Integer'Image(Sieve'Last));
                end loop;
                New_Line;
                loop
                     Put("Lower Bound: ");
                     Get(Low);
                     exit when Low >= 0 and Low < High; -- could be Low <= High. not sure here
                     New_Line;
                     Put_Line(Integer'Image(Low) & " must be between 0 and " & Integer'Image(High));
                end loop;
end Find_Bounds;