comp.lang.ada
 help / color / mirror / Atom feed
From: ucivax!gateway@ucbvax.Berkeley.EDU  (Kenneth Anderson)
Subject: Re: simple help with Text_IO
Date: 3 Feb 93 16:41:41 GMT	[thread overview]
Message-ID: <9302030841.aa14207@Paris.ics.uci.edu> (raw)

In comp.lang.ada you write:

>Could somebody tell me (email please) why this programme,
>which compiles properly, seemingly stalls at the
>line indicated? i.e. I type in a line followed by <cr>,
>but nothing happens. What should happen is that this:

>*:: <the line that was typed>

>should be printed to the console, but isn't. And nothing
>happens. The input prompt:

>*>>

>is printed, then I can type something, but after <cr>
>nothing happens. :(


>With Text_IO; Use Text_IO;

>Procedure main is

>instr, tokstr : String(1..255);

>Begin
>Loop
>    New_Line;
>    Put("*>> ");
>    Get(instr);                 -- this is where it stalls and won't go furthe
r

It stalls here, because Get is trying to fill the string that you gave
it.  I.E. try typing a string that is 255 characters long!  I belive the
way to get around this, is to use the function Get_Line.

>    New_Line;
>    Put("*:: ");
>    Put(instr);
>    Exit When instr="quit";
>End Loop;
>End; --main


Ken

             reply	other threads:[~1993-02-03 16:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-02-03 16:41 Kenneth Anderson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-02-04 18:39 simple help with Text_IO agate!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu
1993-02-03 18:21 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!haven.umd.ed
1993-02-03 15:17 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool
1993-02-03 14:20 enterpoop.mit.edu!spool.mu.edu!howland.reston.ans.net!bogus.sura.net!jhun
1993-02-03 14:14 agate!spool.mu.edu!howland.reston.ans.net!bogus.sura.net!darwin.sura.net!
1993-02-03  1:47 agate!spool.mu.edu!sdd.hp.com!elroy.jpl.nasa.gov!usc.edu!cs.utexas.edu!to
replies disabled

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