From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3667e793a4ececfe X-Google-Attributes: gid103376,public From: John McCabe Subject: Re: Can I overwrite existing text w/o clearing the screen? Date: 1998/11/17 Message-ID: <72rhb0$snm@gcsin3.geccs.gecm.com>#1/1 X-Deja-AN: 412722106 Content-Transfer-Encoding: 7bit References: <3650f8a9.0@silver.truman.edu> Content-Type: text/plain; charset=us-ascii Organization: Avatar Computer Consultants Limited Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-11-17T00:00:00+00:00 List-Id: 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. =====================================================================