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

Home » Public Forums » archive » Re: Overwriting printings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Overwriting printings [message #20456 is a reply to message #20449] Thu, 22 June 2000 00:00 Go to previous messageGo to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
dominik@astro.uva.nl wrote:
>
> In article <395214A5.BA0D21B1@mathstat.dal.ca>,
> simon@mathstat.dal.ca wrote:
>
>> Is there a way to get IDL to overwrite the previous print output,
>> ratherthan starting a new line? I'm running IDL in Linux..
>
> the `$' format character disables the automatic newline,
> the character control-k kill the current output line.
> Use something like this:
>
> for i=1,1000 do begin
> print,format='(A,A,$)',string(13b),string(i)
> endfor
> print,'' ; terminate the current line
>

I do this sort of thing by printing out the backspace character (8B)
however many times I need to overwrite the last output. This way, my
line title doesn't get smushed. In the following snippet, the XXXX, XXX
of XXX... gets overwritten with the current numbers, but the line title
"Transforming....blah blah" does not:

bksp = MAKE_ARRAY( 20, VALUE = 8B )
PRINT, FORMAT = '( /5x, "Transforming IFG for AIRS channel:", /, "XXXX,
XXX of XXX....", $ )'

begin_channel = 0
end_channel = n_channels - 1

FOR i = begin_channel, end_channel DO BEGIN

PRINT, FORMAT = '( a, i4, ", ", i3, " of ", i3, "....", $ )', $
STRING( bksp ), analysis[ i ].channel, i + 1,
n_channels

(I'm sure your news reader will truncate the lines at 80 cols, dammit)

I absolutely agree with the original posters comment about code
slow-down vs. psychological benefits. It's like getting stuck in the
subway with no info about why..... yoicks.

paulv
--
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: pvandelst@ncep.noaa.gov
Camp Springs MD 20746
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: MINIMUM DISTANCE BETWEEN TWO CURVES
Next Topic: Elliptic integral codes?

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

Current Time: Fri Oct 10 08:07:07 PDT 2025

Total time taken to generate the page: 0.00185 seconds