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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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-22 15:51:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-x2.support.nl!psinet-eu-nl!psiuk-p4!uknet!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: functions, packages & characters Date: Fri, 22 Feb 2002 08:41:01 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: References: <20020221130715.12738.00000034@mb-bg.aol.com> <3C753C66.8020509@mail.com> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1014385261 4505 136.170.200.133 (22 Feb 2002 13:41:01 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 22 Feb 2002 13:41:01 GMT 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 Xref: archiver1.google.com comp.lang.ada:20272 Date: 2002-02-22T13:41:01+00:00 List-Id: 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? 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. 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? (I will admit that I have not tried anything like this, so there may be some tiny devil in the details that I'm missing...) MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Randy Brukardt" wrote in message news:u7b1g6cooeo49@corp.supernews.com... > > Text_IO doesn't have direct support for unbounded strings (because > having it would drag the unbounded string library into almost every > program, whether you used it or not). Possibly, there ought to be a > Get_Line for Unbounded strings in a child package of Text_IO (but this > does not exist in Ada 95). This would be quite a bit slower than the > regular Get_Line for long lines, but it could be made acceptably fast > for the common case of short lines. It is possible to write such a > Get_Line out of the primitives in Text_IO, but the result would be > unacceptably slow (because you would have to read a character at a > time - you can't use Get_Line because you can't tell between the case of > a line which exactly fills the buffer and a line which is too long and > does not -- but in the former case, the line terminator is skipped). >