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

Home » Public Forums » archive » Re: Printing to command line without a new line
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: Printing to command line without a new line [message #78230 is a reply to message #78225] Wed, 02 November 2011 11:48 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
jasmeervirdee@gmail.com writes:

> I have a fairly simple question.
> My code takes a fair amount of time to run and I would like
> it to display a percentage number which updates to the
> command line without starting a new line.
>
> So using print one usually does:
>
> for i=0, 100-1, 1 do print, i, '%'
>
> but this creates a long list of numbers. How can I stop a newline
> being created by the print command
>
> I hope this is clear. Does anyone know how to do this?

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

Like this:

IDL> for i=0, 15 do print, i, format='((x, I0),$)'
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Math errors tracked! To a built-in library...
Next Topic: Alert IDL

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

Current Time: Wed Oct 08 15:56:11 PDT 2025

Total time taken to generate the page: 0.00215 seconds