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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-15 18:35:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Wed, 15 Jan 2003 18:44:07 -0800 Organization: AdaWorks Software Engineering Message-ID: <3E261C77.A45D32CC@adaworks.com> References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> <1042086217.253468@master.nyc.kbcfp.com> <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> <3E25FA9A.2549C263@adaworks.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.40.24 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 16 Jan 2003 02:35:06 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:33070 Date: 2003-01-16T02:35:06+00:00 List-Id: "chris.danx" wrote: An appreciation. Unfortunately, even though this will work, I have an problem with my algorithm, as pointed out by several people. In my haste to illustrate the dynamic array, I created a sloppy algorithm. Try a better approach to getting out of the loop. Richard > Richard Riehle wrote: > > > -- modified from example submitted to cla by Bill Findlay > > with Ada.Integer_Text_IO; > > with Ada.Text_IO; > > use Ada; > > procedure try is > > > > function read return integer is > > n : integer; > > begin > > Integer_Text_IO.get(n); > > return n; > > end read; > > > > begin -- Try > > loop > > Dynamic_Array: > > declare > > SUBTYPE S IS INTEGER RANGE READ .. READ; > > A : array(S) of Integer := (others => 0); > > begin -- Dynamic_Array > > exit when S'Last = S'First; > > for I in A'Range > > loop > > Integer_Text_IO.Get(A(I)); > > end loop; > > Text_IO.put_line(integer'image(s'first) > > & " .. " & integer'image(s'last)); > > end Dynamic_Array; > > end loop; > > end try; > > Hey, that's nifty! Never knew you could do stuff like that. > > Chris > -- > for personal replies change spamoff to chris