comp.lang.ada
 help / color / mirror / Atom feed
* Priority of Get() over Put() ? on Mac 10.10.3
@ 2015-04-11  9:13 j.dabel
  2015-04-11 11:07 ` Niklas Holsti
  0 siblings, 1 reply; 7+ messages in thread
From: j.dabel @ 2015-04-11  9:13 UTC (permalink / raw)


when running Exercise 4.4 1 "Table_Of_Square_Roots" of Programming in Ada 2012 by John Barnes, I have to type Last_N without showing me first the Put("What is the largest value please ? "). So the Get command takes over the Put command but this makes no sense for a person who doesn't know what is meant. The Put() command shows up after typing a number.

BTW: the type of Last_N is NOT Integer, it has to be My_Integer as declared in Etc. the same is valid for 4.4. 2.

Juergen Dabel
Schrobenhausen
Germany


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

* Re: Priority of Get() over Put() ? on Mac 10.10.3
  2015-04-11  9:13 Priority of Get() over Put() ? on Mac 10.10.3 j.dabel
@ 2015-04-11 11:07 ` Niklas Holsti
  2015-04-11 15:44   ` j.dabel
  0 siblings, 1 reply; 7+ messages in thread
From: Niklas Holsti @ 2015-04-11 11:07 UTC (permalink / raw)


On 15-04-11 12:13 , j.dabel@t-online.de wrote:
> when running Exercise 4.4 1 "Table_Of_Square_Roots" of Programming in
> Ada 2012 by John Barnes, I have to type Last_N without showing me
> first the Put("What is the largest value please ? "). So the Get
> command takes over the Put command but this makes no sense for a
> person who doesn't know what is meant.

What probably happens is that the text in the "Put" call stays in some 
system or I/O buffer and is not displayed.

Try adding the call Ada.Text_IO.Flush between the Put and the Get. That 
should flush out and display the buffered text. Or you can change the 
Put to a Put_Line, but of course the effect on the screen is a bit 
different.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

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

* Re: Priority of Get() over Put() ? on Mac 10.10.3
  2015-04-11 11:07 ` Niklas Holsti
@ 2015-04-11 15:44   ` j.dabel
  2015-04-12  5:14     ` AdaMagica
  0 siblings, 1 reply; 7+ messages in thread
From: j.dabel @ 2015-04-11 15:44 UTC (permalink / raw)


On Saturday, April 11, 2015 at 1:07:37 PM UTC+2, Niklas Holsti wrote:
> On 15-04-11 12:13 , j.dabel@t-online.de wrote:
> > when running Exercise 4.4 1 "Table_Of_Square_Roots" of Programming in
> > Ada 2012 by John Barnes, I have to type Last_N without showing me
> > first the Put("What is the largest value please ? "). So the Get
> > command takes over the Put command but this makes no sense for a
> > person who doesn't know what is meant.
> 
> What probably happens is that the text in the "Put" call stays in some 
> system or I/O buffer and is not displayed.
> 
> Try adding the call Ada.Text_IO.Flush between the Put and the Get. That 
> should flush out and display the buffered text. Or you can change the 
> Put to a Put_Line, but of course the effect on the screen is a bit 
> different.
> 
> -- 
> Niklas Holsti
> Tidorum Ltd
> niklas holsti tidorum fi
>        .      @       .

Thank you for your help,

Flush didn't help it was Put_Line().
Juergen Dabel
Schrobenhausen


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

* Re: Priority of Get() over Put() ? on Mac 10.10.3
  2015-04-11 15:44   ` j.dabel
@ 2015-04-12  5:14     ` AdaMagica
  2015-04-12  6:11       ` Niklas Holsti
  0 siblings, 1 reply; 7+ messages in thread
From: AdaMagica @ 2015-04-12  5:14 UTC (permalink / raw)


> Flush didn't help it was Put_Line().

Looks like a compiler problem then with Flush.

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

* Re: Priority of Get() over Put() ? on Mac 10.10.3
  2015-04-12  5:14     ` AdaMagica
@ 2015-04-12  6:11       ` Niklas Holsti
  2015-04-12  7:14         ` j.dabel
  2015-04-14  6:01         ` AdaMagica
  0 siblings, 2 replies; 7+ messages in thread
From: Niklas Holsti @ 2015-04-12  6:11 UTC (permalink / raw)


On 15-04-12 08:14 , AdaMagica wrote:
>> Flush didn't help it was Put_Line().
>
> Looks like a compiler problem then with Flush.

I believe that this problem happens when one runs a program within GPS, 
not directly from a terminal window. Apparently GPS adds some 
line-oriented buffering. Earlier discussion at 
http://www.experchange.com/problem-with-output-using-ada-text_io-t4394074.

(By the bye, is a good archive of comp.lang.ada available somewhere? or 
must one go to Google Groups?)

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .

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

* Re: Priority of Get() over Put() ? on Mac 10.10.3
  2015-04-12  6:11       ` Niklas Holsti
@ 2015-04-12  7:14         ` j.dabel
  2015-04-14  6:01         ` AdaMagica
  1 sibling, 0 replies; 7+ messages in thread
From: j.dabel @ 2015-04-12  7:14 UTC (permalink / raw)


On Sunday, April 12, 2015 at 8:11:45 AM UTC+2, Niklas Holsti wrote:
> On 15-04-12 08:14 , AdaMagica wrote:
> >> Flush didn't help it was Put_Line().
> >
> > Looks like a compiler problem then with Flush.
> 
> I believe that this problem happens when one runs a program within GPS, 
> not directly from a terminal window. Apparently GPS adds some 
> line-oriented buffering. Earlier discussion at 
> http://www.experchange.com/problem-with-output-using-ada-text_io-t4394074.
> 
> (By the bye, is a good archive of comp.lang.ada available somewhere? or 
> must one go to Google Groups?)
> 
> -- 
> Niklas Holsti
> Tidorum Ltd
> niklas holsti tidorum fi
>        .      @       .

Yes I was running the program within GPS. Perhaps it is a Mac only problem?

Juergen Dabel
Schrobenhausen


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

* Re: Priority of Get() over Put() ? on Mac 10.10.3
  2015-04-12  6:11       ` Niklas Holsti
  2015-04-12  7:14         ` j.dabel
@ 2015-04-14  6:01         ` AdaMagica
  1 sibling, 0 replies; 7+ messages in thread
From: AdaMagica @ 2015-04-14  6:01 UTC (permalink / raw)


Am Sonntag, 12. April 2015 08:11:45 UTC+2 schrieb Niklas Holsti:
> On 15-04-12 08:14 , AdaMagica wrote:
> >> Flush didn't help it was Put_Line().
> >
> > Looks like a compiler problem then with Flush.
> 
> I believe that this problem happens when one runs a program within GPS, 
> not directly from a terminal window. Apparently GPS adds some 
> line-oriented buffering.

Ah, yes, I remember some differences when running programs via GPS or in a command window.

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

end of thread, other threads:[~2015-04-14  6:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-11  9:13 Priority of Get() over Put() ? on Mac 10.10.3 j.dabel
2015-04-11 11:07 ` Niklas Holsti
2015-04-11 15:44   ` j.dabel
2015-04-12  5:14     ` AdaMagica
2015-04-12  6:11       ` Niklas Holsti
2015-04-12  7:14         ` j.dabel
2015-04-14  6:01         ` AdaMagica

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