comp.lang.ada
 help / color / mirror / Atom feed
* Arrays in Ada 2012
@ 2017-06-06 11:47 Anatoly Chernyshev
  2017-06-06 12:17 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Anatoly Chernyshev @ 2017-06-06 11:47 UTC (permalink / raw)


Hello everyone,

Consider the following nice Ada 2012 construct:

--
procedure test is
   type a1 is array(1..35,1..35,1..35,1..35,1..35,1..35) of long_long_integer;
   ab:a1;
   cnt:long_long_integer:=0;
begin
  for e of ab loop
      cnt:=cnt+1;
      e:=cnt;
   end loop;
end test;
--

Is there a way (e.g. some attribute) to find the  indices of the array for a current e within the cycle above?

Suppose, I want to calculate something with the indices, or have an exit condition.

Of course, I can always build a standard set of for loops, but I already get addicted to that new concept, so don't want to look back.

Thanks in advance.

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

end of thread, other threads:[~2017-06-23  1:17 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-06 11:47 Arrays in Ada 2012 Anatoly Chernyshev
2017-06-06 12:17 ` Dmitry A. Kazakov
2017-06-06 13:17   ` Simon Wright
2017-06-06 13:57     ` Dmitry A. Kazakov
2017-06-06 21:59       ` Simon Wright
2017-06-06 13:19 ` AdaMagica
2017-06-06 20:56   ` Randy Brukardt
2017-06-07  7:06     ` Dmitry A. Kazakov
2017-06-07 11:47       ` Anatoly Chernyshev
2017-06-07 12:15         ` Dmitry A. Kazakov
2017-06-08  0:55         ` Randy Brukardt
2017-06-08  0:51       ` Randy Brukardt
2017-06-08  7:07         ` Dmitry A. Kazakov
2017-06-09  3:23           ` Randy Brukardt
2017-06-18  2:14 ` Arrays in Ada 2020 Ivan Levashev
2017-06-18  3:00   ` Nasser M. Abbasi
2017-06-18 12:06     ` Robert Eachus
2017-06-18 20:15       ` Simon Wright
2017-06-20 13:33         ` Robert Eachus
2017-06-19  6:36       ` Ivan Levashev
2017-06-19 12:06         ` AdaMagica
2017-06-23  1:17           ` Randy Brukardt
2017-06-18 20:15     ` Pascal Obry

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