comp.lang.ada
 help / color / mirror / Atom feed
* How to get a 2D arrays range?
@ 2015-11-22  3:31 John Smith
  2015-11-22  5:02 ` Jeffrey R. Carter
  2015-11-22  7:09 ` Niklas Holsti
  0 siblings, 2 replies; 4+ messages in thread
From: John Smith @ 2015-11-22  3:31 UTC (permalink / raw)


Hello,

I have an array of integers, like so:

ArrayInteger : array (1 .. 10, 1 .. 10) of Integer;
...
ArrayInteger := (others => (others => 0));
...
for iterA in ArrayInteger'Range loop
  for iterB in 1 .. 10 loop
    Ada.Integer_Text_IO.Put(ArrayInteger(iterA, iterB));
  end loop;

  Ada.Text_IO.New_Line;
end loop;

Of the nested for-loop, where I explicitly call out 1 .. 10, I'd like to specify 
the range more dynamically.  How can I do this?

I tried ArrayInteger(0)'Range, with no success...


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-22  8:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-22  3:31 How to get a 2D arrays range? John Smith
2015-11-22  5:02 ` Jeffrey R. Carter
2015-11-22  7:09 ` Niklas Holsti
2015-11-22  8:58   ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox