comp.lang.ada
 help / color / mirror / Atom feed
From: christoph.grein@eurocopter.com
Subject: Re: Weird string I/O problem
Date: Tue, 25 Nov 2008 23:24:19 -0800 (PST)
Date: 2008-11-25T23:24:19-08:00	[thread overview]
Message-ID: <eb67ab0c-6a54-4c47-9e55-2bb78bc498e9@j32g2000yqn.googlegroups.com> (raw)
In-Reply-To: c6f5748b-923f-4077-b33e-a5017309ac46@w39g2000prb.googlegroups.com

>     Put("Enter a float: ");
>     Get(A_Float); -- PROBLEMATIC LINE

Here you enter "12.3<Return>"
Get consumes the number and leaves <Return> in the input stream.

>     Put("Enter a string: ");
>     Get_Line(UBS);

Here, Get_Line consumes the rest of the previous input up to the
<Return>, in your case the rest is empty.
(If you had entered 12.3 xxx<Return>, the contents of UBS would be "
xxx".)
So you have no opportunity to enter a further string.
What you need, is a Skip_Line after the Get(A_Float).



  reply	other threads:[~2008-11-26  7:24 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  5:52 Weird string I/O problem Jerry
2008-11-26  7:24 ` christoph.grein [this message]
2008-11-26  7:38   ` christoph.grein
2008-11-26  8:25     ` Dmitry A. Kazakov
2008-11-26  9:07   ` Jean-Pierre Rosen
2008-11-26 15:21     ` John McCormick
2008-11-26 15:56     ` Adam Beneschan
2008-11-27 10:13       ` Jean-Pierre Rosen
2008-12-01 16:17         ` Adam Beneschan
2008-11-27  4:46 ` Jerry
2008-11-27 10:27   ` Jean-Pierre Rosen
2008-12-01 19:47 ` anon
2008-12-02  5:44   ` christoph.grein
2008-12-02  6:55     ` anon
2008-12-02  7:53       ` christoph.grein
2008-12-02 16:39         ` Adam Beneschan
2008-12-03  9:16           ` anon
2008-12-03 10:42             ` christoph.grein
2008-12-03 12:21               ` John B. Matthews
2008-12-04  0:15               ` anon
2008-12-04  7:31                 ` christoph.grein
2008-12-04  7:56                   ` Ludovic Brenta
2008-12-04  8:46                     ` Georg Bauhaus
2008-12-03 11:35             ` stefan-lucks
2008-12-04  0:27               ` anon
2008-12-04  8:58                 ` stefan-lucks
2008-12-04 22:54                   ` anon
2008-12-05  9:06                     ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox