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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9797292c79ff60c X-Google-Attributes: gid103376,public From: christoph grein Subject: Re: Help: Get/Get_line Date: 1998/05/20 Message-ID: <356231EB.3F2@eurocopter.de>#1/1 X-Deja-AN: 354804905 Content-Transfer-Encoding: 7bit References: <355E0DE6.6867@info.polymtl.ca> MIME-Version: 1.0 NNTP-Posting-Date: Tue, 19 May 1998 21:30:41 EDT Reply-To: christoph.grein@eurocopter.de Content-Type: text/plain; charset=us-ascii Organization: Bell Solutions Newsgroups: comp.lang.ada Date: 1998-05-20T00:00:00+00:00 List-Id: This problem has a very simple solution, but the cause is not very obvious. I've already sent the solution to someone before with the request to forward it to cla, but he didn't do this. So please forward the solution. You have to read the RM about Text_IO very carefully. get(number); reads as many characters as can be interpreted as a whole number and converts this to the result type. Any other characters stay in the input stream. So e.g. if you input "123.45", you will get "number=123", the next "get_line(name, last);" will return ".45..." and any characters until EOL or name'last is reached, whatever occurs first. So if you write get(number); get_line(name, last); and enter on you keyboard 1234 "get(number);" reads 1234, but leaves EOL, which is then immediately read by "get_line(name, last);", which will return "name" empty (unchanged) and "Last=0". This is quite confusing sometimes even to experienced programmers. I hope this helps to let you sort out the solution of your problem. Christoph