comp.lang.ada
 help / color / mirror / Atom feed
From: John McCabe <john@assen.demon.co.uk>
Subject: Re: Can I overwrite existing text w/o clearing the screen?
Date: 1998/11/17
Date: 1998-11-17T00:00:00+00:00	[thread overview]
Message-ID: <72rhb0$snm@gcsin3.geccs.gecm.com> (raw)
In-Reply-To: 3650f8a9.0@silver.truman.edu

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.
=====================================================================






  parent reply	other threads:[~1998-11-17  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
1998-11-18  0:00 ` Rory
replies disabled

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