comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Why does this input get "skipped"?
Date: Mon, 22 Aug 2016 07:00:14 +0200
Date: 2016-08-22T07:00:14+02:00	[thread overview]
Message-ID: <npe0t6$h1p$1@dont-email.me> (raw)
In-Reply-To: <e0e14ec6-0f53-412e-a089-c512d37fc026@googlegroups.com>

Le 21/08/2016 à 02:36, John Smith a écrit :
>> How can I clear out that line terminator?  Another call to
>> Get_Line, but not save the input?
> Adding a Get_Line right after the Integer_Text_IO.Get did get me the
> result that I want.  However, why does this feel like a kludge?

Because you are reading something when you don't want to read something...

There is much more in Text_IO than Get_Line/Put_Line.

In your case, what you want is to be sure that you start a clean new
line, i.e. that the current column of input is 1. The solution is:
   set_col (current_input, 1)

If you are already on column 1, it does nothing, otherwise it will skip
to the beginning of the first non-empty line.

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


  reply	other threads:[~2016-08-22  5:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-20 22:41 Why does this input get "skipped"? John Smith
2016-08-20 23:16 ` Jeffrey R. Carter
2016-08-21  0:01   ` John Smith
2016-08-21  0:36     ` John Smith
2016-08-22  5:00       ` J-P. Rosen [this message]
2016-08-22 22:18       ` rieachus
2016-08-23  6:22         ` J-P. Rosen
2016-08-24 10:34           ` rieachus
2016-08-21  0:50     ` Jeffrey R. Carter
2016-08-21  1:04       ` John Smith
2016-08-21  4:07         ` Jeffrey R. Carter
2016-08-21  0:00 ` rieachus
replies disabled

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