From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef01efac83f51e2e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-18 07:56:05 PST From: "Martin Dowie" Newsgroups: comp.lang.ada References: <3c96047c$1@pull.gecm.com> Subject: Re: looping through variable length array Date: Mon, 18 Mar 2002 15:57:25 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: sg2c11210.sd.edinbr.gmav.gecm.com Message-ID: <3c960e14$1@pull.gecm.com> X-Trace: 18 Mar 2002 15:56:04 GMT, sg2c11210.sd.edinbr.gmav.gecm.com Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!colt.net!newspeer.clara.net!news.clara.net!btnet-peer!btnet-peer0!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!sg2c11210.sd.edinbr.gmav.gecm.com Xref: archiver1.google.com comp.lang.ada:21409 Date: 2002-03-18T15:57:25+00:00 List-Id: "Stephen Frackelton" 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;