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 #27062 is a reply to message #27060] Fri, 05 October 2001 03:55 Go to previous message
A. D. & J.C. Cool is currently offline  A. D. & J.C. Cool
Messages: 16
Registered: February 2000
Junior Member
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.

Hi Paul,

Try building up your format string :-


> IDL> var = 2
> IDL> format_str='('+ string(var,form='(i2)') + '(f6.1))'
> IDL> print,format_str
> ( 2(f6.1))
> IDL> y=[1254.643,643.804]
> IDL> print,y,format=format_str
> 1254.6 643.8
>

There's probably a kosher way of doing this, but hey, it works...

Andrew Cool
[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:25:10 PDT 2025

Total time taken to generate the page: 0.23861 seconds