comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Dowie" <martin.dowie@nospam.baesystems.com>
Subject: Re: looping through variable length array
Date: Mon, 18 Mar 2002 15:57:25 -0000
Date: 2002-03-18T15:57:25+00:00	[thread overview]
Message-ID: <3c960e14$1@pull.gecm.com> (raw)
In-Reply-To: 3c96047c$1@pull.gecm.com

"Stephen Frackelton" <stephen.frackelton@baesystems.com> wrote in message
news:3c96047c$1@pull.gecm.com...
> 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.

declare

   procedure Looping_Routine (Message : String) is
   begin
      for Index in Value'Range loop
         -- Do somthing with Message (Index)
      end loop;
   end Looping_Routine;

   Array1 : String (1 .. 10);
   Array2 : String (1 .. 100);

begin
   Looping_Routine (Message => Array1);
   Looping_Routine (Message => Array2);
end;






  parent reply	other threads:[~2002-03-18 15:57 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
2002-03-18 18:53     ` Larry Hazel
2002-03-18 15:57 ` Martin Dowie [this message]
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