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 #78219 is a reply to message #78218] Wed, 02 November 2011 14:19 Go to previous messageGo to previous message
Russell[1] is currently offline  Russell[1]
Messages: 101
Registered: August 2011
Senior Member
You need to use the C-style printing and use the ANSI escape
sequences. Here's a quick script I used, based on ITT's examples.


pro inline_print

for i=0,10 do begin
ii=strcompress(string(i,f='(I3)'),/rem)
print,f='(%"\33[1M I have %s monkeys\33[1A")',ii
wait,0.1
endfor
print,''

end




On Nov 2, 2:19 pm, "jasmeervir...@gmail.com" <jasmeervir...@gmail.com>
wrote:
> Hi all,
>
> 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?
>
> Cheers
[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: Fri Oct 10 14:47:37 PDT 2025

Total time taken to generate the page: 0.55922 seconds