comp.lang.ada
 help / color / mirror / Atom feed
From: "Stephen Frackelton" <stephen.frackelton@baesystems.com>
Subject: Re: looping through variable length array
Date: Mon, 18 Mar 2002 17:47:38 -0000
Date: 2002-03-18T17:47:38+00:00	[thread overview]
Message-ID: <3c962806$1@pull.gecm.com> (raw)
In-Reply-To: 3C960A83.C2A1E9E1@otelco.net

i would be using 'range anyway
the problem is the array size is variable, i have many declared arrays of
various sizes and wish to write one looping process to cater for all,
obviously i cannot loop through the array name as this only caters for that
instance of the array
thanks
Stephen

"Larry Hazel" <lhhazel@otelco.net> wrote in message
news:3C960A83.C2A1E9E1@otelco.net...
> Stephen Frackelton wrote:
> >
> > i'm attempting to loop through a set of arrays, but theses arrays are of
> > different lengths to cater for various message sizes.
> > but i want to write the loop only once to cater for this.
> > how is the best way to model this ?
> >
> > can i somehow use an unconstrained array ?
> >
> > if i have my data available in a fixed size array, how can i get this
> > variable into a format i can loop through, regardless of the size of the
> > array.
>
> Knowing the number of items in the array, just loop from
>   array_name'first .. array_name'first + number_items - 1
> and you may know that array_name'first is 1, so you can loop from 1 ..
> number_items.
>
> I'm a bit confused by "loop through a set of arrays".
>
> Larry





  reply	other threads:[~2002-03-18 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-18 15:16 looping through variable length array Stephen Frackelton
2002-03-18 15:40 ` Larry Hazel
2002-03-18 17:47   ` Stephen Frackelton [this message]
2002-03-18 18:53     ` Larry Hazel
2002-03-18 15:57 ` Martin Dowie
2002-03-18 21:18 ` Stephen Leake
2002-03-19 18:21 ` Bobby D. Bryant
replies disabled

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