From: enterpoop.mit.edu!spool.mu.edu!howland.reston.ans.net!bogus.sura.net!jhun ix.hcf.jhu.edu!aplcen.apl.jhu.edu!ddsdx2.jhuapl.edu!dlc@ucbvax.Berkeley.EDU (D ave Collard x7468)
Subject: Re: simple help with Text_IO
Date: 3 Feb 93 14:20:38 GMT [thread overview]
Message-ID: <1993Feb3.142038.27379@aplcen.apl.jhu.edu> (raw)
In <C1unnH.Lu9@undergrad.math.waterloo.edu> ccalbrec@laplace.uwaterloo.ca (Cory
C. Albrecht) writes:
>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
> New_Line;
> Put("*:: ");
> Put(instr);
> Exit When instr="quit";
>End Loop;
>End; --main
It doesn't stall, you just haven't finished entering the string yet! Try
keep entering characters until you have entered 255 characters.
That is what get does -- What you want is Get_Line
last : natural;
begin
loop
new_line;
put("*>> ");
get_line(instr, last);
new_line;
Put("*:: ");
Put(instr(1..last);
etc.
--Thor
collard@capsrv.jhuapl.edu
dlc@ddsdx2.jhuapl.edu
next reply other threads:[~1993-02-03 14:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-02-03 14:20 enterpoop.mit.edu!spool.mu.edu!howland.reston.ans.net!bogus.sura.net!jhun [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 16:41 Kenneth Anderson
1993-02-03 15:17 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool
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