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,794c64d1f9164710 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-25 07:19:35 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: functions, packages & characters Date: Fri, 22 Feb 2002 20:08:06 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <20020221130715.12738.00000034@mb-bg.aol.com> <3C753C66.8020509@mail.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:20370 Date: 2002-02-22T20:08:06-05:00 List-Id: "Marin David Condic" wrote in message news:a55hpd$4cp$1@nh.pace.co.uk... > Wait a minute...... I seem to recall a nifty example of how you could return > an arbitrary length string from a function that used Get/Get_Line (?) and > recursed in the event that the line was longer than the buffer. It might be > in a code example somewhere like on AdaPower? declare function Get_Line return String is Line : String (1 .. 80 + 1); Last : Natural; begin Text_IO.Get_Line (Line, Last); if Last < Line'Last then return Line (Line'First .. Last); else return Line & Get_Line; end if; end Get_Line; Line : constant String := Get_Line; begin Put_Line (Line); end; > If you can do that, why not a > similar subprogram for Unbounded_String? It would be even easier and not > require recursion since you could just keep reading some arbitrary sized > buffer in a loop and appending it to an Unbounded_String that is returned to > the caller. I showed this in my last post. > Speed may be an issue, but with a reasonably large buffer, I don't think it > would be unacceptably slow. Why would you have to read it one character at a > time? No, you don't have to read one character at a time, as is shown above.