Re: FORMAT question [message #27040] |
Sun, 07 October 2001 23:52  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Paul van Delst wrote:
>
> Reimar Bauer wrote:
>>
>> 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.
>>
>> Dear Paul,
>>
>> this is the first time I am able to give totally the same answer
>> to someone in this newsgroup at the same day. Don't you read others
>> articles?
>
> Actually your reply doesn't directly apply to the problem he's having - i.e. a repreat
> specifier in a format statements - although your software might.
>
I agree, I have not seen this problem. The routine could be useful too
if you don't
know anything about the format of the data.
The online help with the keyword "Format codes" describes much more
formatting codes
and syntax.
Reimar
> In any case, apart from Andrew's solution, I would also try:
>
> IDL> var=2
> IDL> fmt='('+strtrim(var,2)+'(f6.1))'
> IDL> print, fmt
> (2(f6.1))
>
> to avoid the need for _another_ format when outputting var into the format string.
>
> paulv
>
> --
> Paul van Delst Religious and cultural
> CIMSS @ NOAA/NCEP purity is a fundamentalist
> Ph: (301)763-8000 x7274 fantasy
> Fax:(301)763-8545 V.S.Naipaul
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ======
read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
|
|
|