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

Home » Public Forums » archive » Re: FORMAT question
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: FORMAT question [message #27049 is a reply to message #27040] Fri, 05 October 2001 12:45 Go to previous messageGo to previous message
Phillip David is currently offline  Phillip David
Messages: 36
Registered: April 1999
Member
try the even simpler command:
x = findgen(10)*!pi
print, x, format='(' + strtrim(n_elements(x),2) + '(f10.6))'

This will print out all elements on a single line.

As an additional note, if you use print, x, format='((f10.6))', you'll
get each element printed on its own line, but they still all get
printed. More useful, perhaps, is the idea that you can get an
appropriate line length this way.

x = findgen(1000)*!pi
print, x, format='(10(f10.6))'

will give you 100 lines with 10 elements each on them.

You probably knew this, but there may have been some who didn't.

Phillip

Paul Manusiu wrote:
>
> Hi,
> Does anyone if its possible to use a function or variable as a parameter
> or option to FORMAT ?
> ;e.g. if I have
> print, blah, FORMAT = '(2(F6.1))'
> ; but I want something like this
> for var = 0, 10 do $
> print, blah[var,*], FORMAT = '(var(F6.1))'
>
> Any help please will be much appreciated
>
> Paul M.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 5.4 and win2000 problems: Windows IDLDE crash poll
Next Topic: How to run a exe program?

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

Current Time: Fri Oct 10 05:23:09 PDT 2025

Total time taken to generate the page: 0.39983 seconds