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

Home » Public Forums » archive » Update stdout instead of writing new 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
Update stdout instead of writing new line [message #85027] Mon, 24 June 2013 13:17 Go to next message
stefan.meingast is currently offline  stefan.meingast
Messages: 30
Registered: June 2012
Member
Hey

I had hoped that someone here might be able to answer this quick question:

I like to monitor my progress by writing stuff into the terminal, but it would be much more convenient to update the output instead of writing a new line.

e.g.:
FOR i=1,100 DO PRINT, i

writes 100 lines in the terminal. Would it be possible to overwrite the previous output so that in the end only one line is used?

Thanks for any hints :)
Re: Update stdout instead of writing new line [message #85028 is a reply to message #85027] Mon, 24 June 2013 13:29 Go to previous messageGo to next message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Monday, June 24, 2013 10:17:49 PM UTC+2, Stefan wrote:
> Hey
>
>
>
> I had hoped that someone here might be able to answer this quick question:
>
>
>
> I like to monitor my progress by writing stuff into the terminal, but it would be much more convenient to update the output instead of writing a new line.
>
>
>
> e.g.:
>
> FOR i=1,100 DO PRINT, i
>
>
>
> writes 100 lines in the terminal. Would it be possible to overwrite the previous output so that in the end only one line is used?
>
>
>
> Thanks for any hints :)

FOR i=1,100 DO PRINT, string(13b), i, format='(A,I,$)'

regards,
Lajos
Re: Update stdout instead of writing new line [message #85029 is a reply to message #85027] Mon, 24 June 2013 13:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Stefan writes:

> I had hoped that someone here might be able to answer this quick question:
>
> I like to monitor my progress by writing stuff into the terminal, but it would be much more convenient to update the output instead of writing a new line.
>
> e.g.:
> FOR i=1,100 DO PRINT, i
>
> writes 100 lines in the terminal. Would it be possible to overwrite the previous output so that in the end only one line is used?
>
> Thanks for any hints :)

http://www.idlcoyote.com/fileio_tips/lfsuppress.html

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: Update stdout instead of writing new line [message #85030 is a reply to message #85027] Mon, 24 June 2013 13:46 Go to previous messageGo to next message
stefan.meingast is currently offline  stefan.meingast
Messages: 30
Registered: June 2012
Member
Wow, quick answer, thanks!!! :)

Alright, that's a very good start, this indeed writes everything into one line, but is it also possible to overwrite the previous output? In this way I would end up with VERY long lines. :)
Re: Update stdout instead of writing new line [message #85031 is a reply to message #85030] Mon, 24 June 2013 14:00 Go to previous messageGo to next message
Lajos Foldy is currently offline  Lajos Foldy
Messages: 176
Registered: December 2011
Senior Member
On Monday, June 24, 2013 10:46:40 PM UTC+2, Stefan wrote:
> Wow, quick answer, thanks!!! :)
>
>
>
> Alright, that's a very good start, this indeed writes everything into one line, but is it also possible to overwrite the previous output? In this way I would end up with VERY long lines. :)


Have you tried my suggestion? 13b is carriage return, i.e. go to the beginning of line.

FOR i=1,100 DO PRINT, string(13b), i, format='(A,I,$)'

regards,
Lajos
Re: Update stdout instead of writing new line [message #85032 is a reply to message #85027] Mon, 24 June 2013 15:19 Go to previous messageGo to next message
stefan.meingast is currently offline  stefan.meingast
Messages: 30
Registered: June 2012
Member
Ah, in fact I have overlooked your answer. ;)

This works, thanks a lot!! :)
Re: Update stdout instead of writing new line [message #85033 is a reply to message #85031] Mon, 24 June 2013 23:54 Go to previous messageGo to next message
Karlo Janos is currently offline  Karlo Janos
Messages: 31
Registered: July 2008
Member
> Have you tried my suggestion? 13b is carriage return, i.e. go to the
beginning of line.
>
> FOR i=1,100 DO PRINT, string(13b), i, format='(A,I,$)'

Does this also work with the IDL console of the editor environment?
Regards

Karlo
Re: Update stdout instead of writing new line [message #85038 is a reply to message #85033] Tue, 25 June 2013 07:55 Go to previous message
Bill Nel is currently offline  Bill Nel
Messages: 31
Registered: October 2010
Member
>> FOR i=1,100 DO PRINT, string(13b), i, format='(A,I,$)'

>
> Does this also work with the IDL console of the editor environment?


Nope. My notes say it's been broken in Workbench since 7.0.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: CONTOUR and automatic gridding of irregularly spaced data
Next Topic: USGS DEM file geolocation questions

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

Current Time: Wed Oct 08 11:36:30 PDT 2025

Total time taken to generate the page: 0.00493 seconds