comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Overwriting the terminal output line
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Overwriting the terminal output line [message #29322] Thu, 14 February 2002 11:07 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Kenneth Bowman <k-bowman@null.tamu.edu> writes:
> Does anyone know how to overwrite the terminal output line?
>
>
> The following does not do what I want:
>
> IDL> FOR i = 0, 10 DO PRINT, i, FORMAT = "($, 'i = ' ,I4, T1)"
> i = 0i = 1i = 2i = 3i = 4i = 5i = 6i = 7i = 8i = 9i = 10IDL>
>
> The $ supresses the newline, but T1 does not reposition the
> pointer to the beginning of the line.
...

Hi Ken--

Does something like STATUSLINE help you? [ Assumes you are running on
an ANSI-like terminal. ] I use ANSI escape characters to control the
cursor position, so it's not portable to every type of terminal. As I
recall, I couldn't find a simply way to reposition the cursor using
FORMAT statements.

Craig

http://cow.physics.wisc.edu/~craigm/idl/idl.html (under Miscellaneous)

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Overwriting the terminal output line [message #29401 is a reply to message #29322] Fri, 15 February 2002 11:05 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <ony9hv286w.fsf@cow.physics.wisc.edu>,
Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote:

> Does something like STATUSLINE help you? [ Assumes you are running on
> an ANSI-like terminal. ] I use ANSI escape characters to control the
> cursor position, so it's not portable to every type of terminal. As I
> recall, I couldn't find a simply way to reposition the cursor using
> FORMAT statements.

Thanks, Craig. STATUSLINE works fine on our unix boxes (vt100).

I added a blank "PRINT" in the /CLOSE block to ensure that
upon close the IDL prompt does not over-write the status line.

if keyword_set(close) AND n_elements(statusline_unit) GE 1 then begin
if statusline_unit(0) LT 0 then return
free_lun, statusline_unit(0)
statusline_unit = -1L
PRINT
return
endif

I doesn't work on my Mac however (no surprise). Maybe when the OS X
(unix-like) version is available.

Ken
Re: Overwriting the terminal output line [message #29407 is a reply to message #29322] Fri, 15 February 2002 08:53 Go to previous message
weitkamp is currently offline  weitkamp
Messages: 33
Registered: October 1998
Member
Hi Ken and Craig,

Craig Markwardt <craigmnet@cow.physics.wisc.edu> wrote in message news:<ony9hv286w.fsf@cow.physics.wisc.edu>...
>
> Does something like STATUSLINE help you? [ Assumes you are running on
> an ANSI-like terminal. ] I use ANSI escape characters to control the
> cursor position, so it's not portable to every type of terminal. As I
> recall, I couldn't find a simply way to reposition the cursor using
> FORMAT statements.

I don't know how STATUSLINE works or what can be termed "simple", but
the following small modification to Ken's code (putting a CR in the
format string) works on VT-52 compatible terminals (is that the same
as ANSI?). I think it fails on Windows though (because the CR makes a
new line there). Here it is:

FOR i = 0, 10 DO PRINT, i, FORMAT = '($, "i = " ,I4,
"'+STRING(13B)+'")'

Timm
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: get_lun returns LUN already in use
Next Topic: Overwriting the terminal output line

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:53:22 PDT 2025

Total time taken to generate the page: 0.00591 seconds