comp.lang.ada
 help / color / mirror / Atom feed
* Can I overwrite existing text w/o clearing the screen?
@ 1998-11-17  0:00 Josh Highley
  1998-11-17  0:00 ` Carl Bauman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Josh Highley @ 1998-11-17  0:00 UTC (permalink / raw)


I've wrote a task to output the time.  I want to continually update the 
time every second in the lower right hand corner of the screen without 
causing a new line and without clearing the entire screen.  I've tried 
set_col and set_line but it causes a new line.  I've been successful 
using AdaGraph v0.5 but its other input and output operations are very 
limited.  Basically, can I overwrite existing text without clearing the 
entire screen or causing a new line?  Hopefully, still having Ada's 
input and output commands still available.

Thanks,

Josh Highley
joshhighley@hotmail.com





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

* Re: Can I overwrite existing text w/o clearing the screen?
  1998-11-17  0:00 Can I overwrite existing text w/o clearing the screen? Josh Highley
  1998-11-17  0:00 ` Carl Bauman
@ 1998-11-17  0:00 ` John McCabe
  1998-11-18  0:00 ` Rory
  2 siblings, 0 replies; 4+ messages in thread
From: John McCabe @ 1998-11-17  0:00 UTC (permalink / raw)


joshhighley@hotmail.com (Josh Highley) wrote:
>I've wrote a task to output the time.  I want to continually update the 
>time every second in the lower right hand corner of the screen without 
>causing a new line and without clearing the entire screen.  I've tried 
>set_col and set_line but it causes a new line.  I've been successful 
>using AdaGraph v0.5 but its other input and output operations are very 
>limited.  Basically, can I overwrite existing text without clearing the 
>entire screen or causing a new line?  Hopefully, still having Ada's 
>input and output commands still available.

It all really depends on what type of screen you are using. You may have 
to use escape codes* to position the cursor before using Ada.Text_IO.Put 
(or alternative) to output the time, then possibly using 
Ada.Text_IO.Flush to make sure it is sent out rather than buffered.

If you have GNAT, I seem to remember there was one of the example 
programs that showed the "dining philosophers" thing using a simple 
package that used some escape codes to print to certain parts of the 
display. That would certainly be worth checking out.

An alternative is to use bindings to the curses library if you have 
access to it.

*Escape Codes give you the facilities for moveing the cursor around the 
screen, and doing interesting things. Some of DECs escape codes for the 
VT2x0-> series of terminals and so on allowed "scrolling regions" to be 
defined so that you could have one section of the display acting like a 
normal terminal while another section was fixed. There are also ANSI 
standard ones which I think the DEC ones are a superset of but I'm not 
100% sure on that as its a while since I used them.


Hope this helps.

-- 
Best Regards
John McCabe
---------------------------------------------------------------------
Marconi Electronic Systems
Simulation & Training Division
=====================================================================
Not necessarily my company or service providers opinions.
=====================================================================






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

* Re: Can I overwrite existing text w/o clearing the screen?
  1998-11-17  0:00 Can I overwrite existing text w/o clearing the screen? Josh Highley
@ 1998-11-17  0:00 ` Carl Bauman
  1998-11-17  0:00 ` John McCabe
  1998-11-18  0:00 ` Rory
  2 siblings, 0 replies; 4+ messages in thread
From: Carl Bauman @ 1998-11-17  0:00 UTC (permalink / raw)



Josh Highley wrote in message <3650f8a9.0@silver.truman.edu>...
>I've wrote a task to output the time.  I want to continually update the
>time every second in the lower right hand corner of the screen without
>causing a new line and without clearing the entire screen.  I've tried
>set_col and set_line but it causes a new line.  I've been successful
>using AdaGraph v0.5 but its other input and output operations are very
>limited.  Basically, can I overwrite existing text without clearing the
>entire screen or causing a new line?  Hopefully, still having Ada's
>input and output commands still available.
>
How close to the right are you writing?  If your output is designed to place
the last digit in column 80, the cursor will end up in column 81, which is
off the screen and *seems* to make a NL, but really is a wrap-around.  If
this is the case, try writing starting one column to the left.

-CB








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

* Re: Can I overwrite existing text w/o clearing the screen?
  1998-11-17  0:00 Can I overwrite existing text w/o clearing the screen? Josh Highley
  1998-11-17  0:00 ` Carl Bauman
  1998-11-17  0:00 ` John McCabe
@ 1998-11-18  0:00 ` Rory
  2 siblings, 0 replies; 4+ messages in thread
From: Rory @ 1998-11-18  0:00 UTC (permalink / raw)


Josh,

If you are working in a MS Windows environment and using a console window
look at this site - http://stad.dsl.nl/~jvandyk/#CONSOLE .


Josh Highley wrote:

> I've wrote a task to output the time.  I want to continually update the
> time every second in the lower right hand corner of the screen without
> causing a new line and without clearing the entire screen.  I've tried
> set_col and set_line but it causes a new line.  I've been successful
> using AdaGraph v0.5 but its other input and output operations are very
> limited.  Basically, can I overwrite existing text without clearing the
> entire screen or causing a new line?  Hopefully, still having Ada's
> input and output commands still available.
>
> Thanks,
>
> Josh Highley
> joshhighley@hotmail.com







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

end of thread, other threads:[~1998-11-18  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-17  0:00 Can I overwrite existing text w/o clearing the screen? Josh Highley
1998-11-17  0:00 ` Carl Bauman
1998-11-17  0:00 ` John McCabe
1998-11-18  0:00 ` Rory

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