comp.lang.ada
 help / color / mirror / Atom feed
* Text_io, beginer's question
@ 1996-10-18  0:00 Xuren Huang
  1996-10-21  0:00 ` John Herro
  1996-10-24  0:00 ` Wiley C. Wimberly, Jr.
  0 siblings, 2 replies; 4+ messages in thread
From: Xuren Huang @ 1996-10-18  0:00 UTC (permalink / raw)



Wrote a loop to read in strings along with other types of variable from
keyboard.  Except the first time it was encounted in the loop, the line
" Text_IO.Get_Line(String, StringLength)" would not be executed.  Any
idea how to fix that?  BTW, I am using win95 GNAT v.304a.  Thanks in
advance.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Text_io, beginer's question
  1996-10-18  0:00 Text_io, beginer's question Xuren Huang
@ 1996-10-21  0:00 ` John Herro
  1996-10-24  0:00 ` Wiley C. Wimberly, Jr.
  1 sibling, 0 replies; 4+ messages in thread
From: John Herro @ 1996-10-21  0:00 UTC (permalink / raw)



Xuren Huang <Xuren.Huang@mail.wdn.com> writes:
> Wrote a loop to read in strings along with other
> types of variable from keyboard.  Except the
> first time it was encounted in the loop, the line
> " Text_IO.Get_Line(String, StringLength)"
> would not be executed.  Any idea how to fix that?

Please show us the loop and perhaps some of the code before the loop, and
we'll try to help you.

- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Text_io, beginer's question
  1996-10-18  0:00 Text_io, beginer's question Xuren Huang
  1996-10-21  0:00 ` John Herro
@ 1996-10-24  0:00 ` Wiley C. Wimberly, Jr.
  1996-10-29  0:00   ` Frank C. Post
  1 sibling, 1 reply; 4+ messages in thread
From: Wiley C. Wimberly, Jr. @ 1996-10-24  0:00 UTC (permalink / raw)



In article <32671BAF.D25@mail.wdn.com>, Xuren.Huang@mail.wdn.com wrote:

> Wrote a loop to read in strings along with other types of variable from
> keyboard.  Except the first time it was encounted in the loop, the line
> " Text_IO.Get_Line(String, StringLength)" would not be executed.  Any
> idea how to fix that?  BTW, I am using win95 GNAT v.304a.  Thanks in
> advance.

Stick a Text_IO.Skip_Line in the code right before the loop. This might work.
I have had similar problems using Get_Line and sometimes a Skip_Line will help.
I don't know why, but if it works it works.

Hope this helps.

Wiley Wimberly




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Text_io, beginer's question
  1996-10-24  0:00 ` Wiley C. Wimberly, Jr.
@ 1996-10-29  0:00   ` Frank C. Post
  0 siblings, 0 replies; 4+ messages in thread
From: Frank C. Post @ 1996-10-29  0:00 UTC (permalink / raw)



Try this:

fname        : fname_type := (others=>' ');
fname_ndx : natural        := natural'first;

text_io.get_line(fname,fname_ndx);
if fname_ndx = fname'last then
   text_io.skip_line;
end if;

Indiscriminant use of text_io.skip_lines commonly cause more problems than
they solve.  If you want to know why, send me some email and I'll send you
a personal reply.

--postman

> > Wrote a loop to read in strings along with other types of variable from
> > keyboard.  Except the first time it was encounted in the loop, the line
> > " Text_IO.Get_Line(String, StringLength)" would not be executed.  Any
> > idea how to fix that?  BTW, I am using win95 GNAT v.304a.  Thanks in
> > advance.
> 
> Stick a Text_IO.Skip_Line in the code right before the loop. This might
work.
> I have had similar problems using Get_Line and sometimes a Skip_Line will
help.
> I don't know why, but if it works it works.
> 
> Hope this helps.
> 
> Wiley Wimberly
> 




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-10-29  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-18  0:00 Text_io, beginer's question Xuren Huang
1996-10-21  0:00 ` John Herro
1996-10-24  0:00 ` Wiley C. Wimberly, Jr.
1996-10-29  0:00   ` Frank C. Post

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