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

Home » Public Forums » archive » How do I use FORMAT as I would SPRINTF?? Please Help!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How do I use FORMAT as I would SPRINTF?? Please Help! [message #32125] Thu, 19 September 2002 03:23 Go to previous message
Brian Huether is currently offline  Brian Huether
Messages: 12
Registered: September 2002
Junior Member
I am quite perplexed by the IDL FORMAT keyword. I am used to MATLAB where I
can quite simply use the sprintf command. For instance, in MATLAB, the
command

s = sprintf('IDL has been driving me crazy for the last %d days', 10)

would result in a string that contains

'IDL has been driving me crazy for the last 10 days'

What I really need to do is something like this:

s = sprintf('SIZE(%s, /%s)', arrayname, somekeyword)

So if arrayname is A and somekeyword is TYPE, then the resulting string
would be

'SIZE(A, /TYPE)'

It is a meaningless example but hopefully you see what I want to do (i.e. I
need to execute IDL commands in a loop, where each time through, the command
input parameters are varying and are specified by indexing arrays that
contain the parameters)
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: How do I use FORMAT as I would SPRINTF?? Please Help!
Next Topic: Re: Displaying data in 3 coodinates

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

Current Time: Fri Oct 10 05:17:10 PDT 2025

Total time taken to generate the page: 0.39946 seconds