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

Home » Public Forums » archive » Re: using an unlnown number of keywords
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: using an unlnown number of keywords [message #27411 is a reply to message #27391] Fri, 19 October 2001 15:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Sean Raffuse (sean@me.wustl.edu) writes:

> I'm trying to write a more or less universal procedure that takes a data
> structure and prints the variables out one by one one a line in an ascii
> file. The problem is that the structure could have any number of variables.
> I want to do this:
>
> printf, lun, structure.var1, structure.var2, structure.var3, . . .,
> structure.varN
>
> If I know N, is there a way to do this without resorting to N cases?

How about something like this:

numTags = N_Tags(structure)
PrintF, lun, structure, Format='(' + StrTrim(numTags,2) + 'F10.2)'

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: profiler
Next Topic: Re: Really really long format keywords

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

Current Time: Wed Oct 08 19:02:30 PDT 2025

Total time taken to generate the page: 0.00415 seconds