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

Home » Public Forums » archive » Re: Again: How to use FORMAT like sprintf??
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: Again: How to use FORMAT like sprintf?? [message #32225] Wed, 25 September 2002 07:24 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Brian Huether wrote:
>
> I posted this question and got some great ansers but everytime I tried the
> examples that you all showed me, IDL gave me this error:
>
> Unexpected text in format
>
> I am using IDL 5.2. Could that be the problem? If so, can someone explain
> how to do what I need using version 5.2? Here is my original message:

I don't know when IDL started supporting C style format codes; it might
not have done so yet in 5.2. In that case, you'll need to learn to use
the Fortran-style format codes instead:

IDL> s = string(10, FORMAT= $
IDL> '("IDL has been driving me crazy for the last ",I0," days")' )
IDL> print,s
IDL has been driving me crazy for the last 10 days

IDL> arrayname='A'
IDL> somekeyword='TYPE'
IDL> s = string(arrayname, somekeyword, FORMAT= $
IDL> '("SIZE(",A0,", /",A0,")")' )
IDL> print,s
SIZE(A, /TYPE)

Just look in the online help, or your user's guide, for 'format codes'.
[Message index]
 
Read Message
Read Message
Previous Topic: Re: What's better: 1 big HDF file or several samller ones??
Next Topic: TEST -- Ignore

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

Current Time: Fri Oct 10 07:42:14 PDT 2025

Total time taken to generate the page: 1.84003 seconds