comp.lang.ada
 help / color / mirror / Atom feed
From: John Smith <yoursurrogategod@gmail.com>
Subject: How to get a 2D arrays range?
Date: Sat, 21 Nov 2015 19:31:36 -0800 (PST)
Date: 2015-11-21T19:31:36-08:00	[thread overview]
Message-ID: <75e0a3fe-a4fc-43e5-a773-06d7bb553b38@googlegroups.com> (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...


             reply	other threads:[~2015-11-22  3:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-22  3:31 John Smith [this message]
2015-11-22  5:02 ` How to get a 2D arrays range? Jeffrey R. Carter
2015-11-22  7:09 ` Niklas Holsti
2015-11-22  8:58   ` Simon Wright
replies disabled

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