Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Update stdout instead of writing new line
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
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
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.")
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. :)
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
Ah, in fact I have overlooked your answer. ;) This works, thanks a lot!! :)
> 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
>> 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.