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

Home » Public Forums » archive » Print format question for the Experts
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Print format question for the Experts [message #25988] Thu, 02 August 2001 11:51 Go to previous message
jmcfee is currently offline  jmcfee
Messages: 17
Registered: August 1995
Junior Member
I have a question which I think should have a simple answer. Being a master of
kludging code for physics problems, it's not surprising that I haven't been able
to figure it out. I'm hoping the experts in this group can.

I am using IDL to read records one at a time from a file and I want to print out
a message that each record was successfully read, i.e., I would print something
like the following for record 5:

Record number 5 out of 1500

Because I can have several thousand records in a run, I do not want to have a
flowing list like:

...
Record number 1034 out of 1500
Record number 1035 out of 1500
Record number 1036 out of 1500
...etc.

but instead just want one line where the record number increments, i.e.,

Record number n out of 1500 [where n changes at the same spot]


To do that I tried the following code:

i=0
print, format='($,"Record number ",t19,i6,t27,"out of " , t28,i6)',i+1,max_rec
for i=0,max_rec-1 do begin
read_a_record_function
print, format='($,tl42,i6)', i+1
endfor

What I get is something like:

Record number 1 out of 1500 2 3 4 5 6 7 8 9 10 11 13 14
15....etc.

In other words, the $ format character supresses the new line, but each new
print sets the next line's "left-right" pointer at the right edge of the
previous printed line.

I've tried the t format char as well as the tl character with no more luck.

Does anybody know how to do this?

Thanks

John McFee
--
Dr. John E. McFee
Defence Research Establishment Suffield
Box 4000, Medicine Hat, AB Canada T1A 8K6
(403) 544-4739 (voice) 544-4704 (fax)
e-mail: John.McFee@dres.dnd.ca
--
____________
Dr. John E. McFee | John.McFee@dres.dnd.ca
Head Threat Detection Group | www.dres.dnd.ca, www.ccmat.gc.ca
Defence Research Establishment Suffield | PH: 403-544-4739
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Print format question for the Experts
Next Topic: matching fields in ascii or text files.

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

Current Time: Wed Oct 08 17:58:01 PDT 2025

Total time taken to generate the page: 0.00484 seconds