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,4d6ffb27cf9c5e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-17 10:31:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: HELP!!!!!! References: <9qk4lr$1tvj$1@newsreader1.mclink.it> X-Newsreader: Tom's custom newsreader Message-ID: Date: Wed, 17 Oct 2001 17:31:52 GMT NNTP-Posting-Host: 24.7.82.199 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 1003339912 24.7.82.199 (Wed, 17 Oct 2001 10:31:52 PDT) NNTP-Posting-Date: Wed, 17 Oct 2001 10:31:52 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:14836 Date: 2001-10-17T17:31:52+00:00 List-Id: > I would like to make a program in wich a string is given in input and the > dimension of it is unknown (till someone insert it...) > HOW CAN I DO?????? (without using hundreds of lines) function Fetch_Message return String is -- Does one or more Get_Line's to return an arbitrarily large string. Message : String(1 .. 80); -- usually adequate Last : Natural; begin Ada.Text_IO.Get_Line(Message, Last); if Last = Message'last then -- there's still more, fetch it return Message(Message'first .. Last) & Fetch_Message; end if; return Message(Message'first .. Last); end Fetch_Message; > Just a consideration, string's manage in Ada is not so beutifull: i can > implement a server without problems but i cannot take a string in > input........... When you find something simple seems hard to do in Ada, you must be missing something. When you find something hard is hard to do, there's probably a better way in Ada.