comp.lang.ada
 help / color / mirror / Atom feed
* Problems in GNAT with get_line
@ 1996-06-04  0:00 Peteri Matti
  1996-06-08  0:00 ` Boaz Chow
  0 siblings, 1 reply; 2+ messages in thread
From: Peteri Matti @ 1996-06-04  0:00 UTC (permalink / raw)




	Hi

  I've got this little problem that for some reason get_line doesn't stop 
to wait the user input.

  So, I use GNAT95, and in my main program I call this subprogram where I 
make these declarations
 
	ansStr	:string(1..stringMax);
	strLgt	:integer;

and in the body I put something on the screen with put_line and put. 
After this I want to read a string with a command

	get_line(ansStr,strLgt);

but to my suprise my program doesn't wait for the input and as I have on 
the next line

	put(ansStr & "foo");

there's nothing intelligent on ansStr. And I get a "raised constraint 
error"...

  And if I use simply get(ansSTr); it stops waitin' for user input and waits 
and waits and nothing goes on...

  So where could I go wrong? At the GNAT examples there is an example 
that uses the same kind on declarations and commands.

  Thanks in advance - I'm sure it's some stupid little mistake but I 
haven't been able to detect it myself.

				Matti

----------------------------------------------------------
Matti Peteri 			Residence Universitaire
Computer Science 4rth year	6 Bis Rue Winston Churchill
peteri@linux.utc.fr		60200 Compiegne, France

-- 
----------------------------------------------------------
Matti Peteri 			Residence Universitaire
Computer Science 4rth year	6 Bis Rue Winston Churchill
peteri@linux.utc.fr		60200 Compiegne, France




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

* Re: Problems in GNAT with get_line
  1996-06-04  0:00 Problems in GNAT with get_line Peteri Matti
@ 1996-06-08  0:00 ` Boaz Chow
  0 siblings, 0 replies; 2+ messages in thread
From: Boaz Chow @ 1996-06-08  0:00 UTC (permalink / raw)



Try put a SKIP_LINE in front of your GET_LINE. 
 
On Jun 04, 1996 14:41:25 in article <Problems in GNAT with get_line>,
'p135577@proffa.cc.tut.fi (Peteri Matti)' wrote: 
 
 
> 
>	Hi 
> 
>I've got this little problem that for some reason get_line doesn't stop  
>to wait the user input. 
> 
>So, I use GNAT95, and in my main program I call this subprogram where I  
>make these declarations 
> 
>	ansStr	:string(1..stringMax); 
>	strLgt	:integer; 
> 
>and in the body I put something on the screen with put_line and put.  
>After this I want to read a string with a command 
> 
>	get_line(ansStr,strLgt); 
> 
>but to my suprise my program doesn't wait for the input and as I have on  
>the next line 
> 
>	put(ansStr & "foo"); 
> 
>there's nothing intelligent on ansStr. And I get a "raised constraint  
>error"... 
> 
>And if I use simply get(ansSTr); it stops waitin' for user input and waits
 
>and waits and nothing goes on... 
> 
>So where could I go wrong? At the GNAT examples there is an example  
>that uses the same kind on declarations and commands. 
> 
>Thanks in advance - I'm sure it's some stupid little mistake but I  
>haven't been able to detect it myself. 
> 
>				Matti 
> 
>---------------------------------------------------------- 
>Matti Peteri 			Residence Universitaire 
>Computer Science 4rth year	6 Bis Rue Winston Churchill 
>peteri@linux.utc.fr		60200 Compiegne, France 
> 
>--  
>---------------------------------------------------------- 
>Matti Peteri 			Residence Universitaire 
>Computer Science 4rth year	6 Bis Rue Winston Churchill 
>peteri@linux.utc.fr		60200 Compiegne, France 
-- 
   ______   Meow 
   \ OO /  _/  
  :(__ =) 
    U \\ 
http://www.sci.csupomona.edu/~cchow 





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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-04  0:00 Problems in GNAT with get_line Peteri Matti
1996-06-08  0:00 ` Boaz Chow

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