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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d93b7c6dd17cbc81 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Strings and reading from a file Date: 1999/05/13 Message-ID: <7hf2bc$imm$1@nnrp1.deja.com>#1/1 X-Deja-AN: 477471207 References: <7han2q$jkp$1@news.iinet.net.au> <7hbnnl$rca$1@nnrp1.deja.com> <7hc358$ha5$1@news.iinet.net.au> <37399913.BD928DD1@pwfl.com> <7hevh1$g08$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x30.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Thu May 13 17:32:27 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-05-13T00:00:00+00:00 List-Id: In article <7hevh1$g08$1@nnrp1.deja.com>, jrcarter001@my-dejanews.com wrote: > In article <37399913.BD928DD1@pwfl.com>, > diespammer@pwfl.com wrote: > > ... > > > function Next_Line return String is > > Str : String (1..256) ; > > Len : Natural ; > > begin > > Get_Line ( > > Item => Str, > > Last => Len) ; > > return Str (1..Len) ; > > end Next_Line ; > > ... > > Make the function recursive, and it can return a string of any length, > eliminating that nagging worry about strings that are longer than > whatever magic number you used in the function. Surely you don't mean (forgive me if Deja decides to throw away my formatting): function Next_Line return String is Char : Character; Next_Char : Character; EOL : Boolean; begin Get (Char); Look_Ahead (Next_Char, EOL); if EOL then return (1 => Char); else return Char & Next_Line; end if; end Next_Line; I think we may have just smoked out a Lisp programmer... -- T.E.D. --== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.---