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

Home » Public Forums » archive » 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
Again: How to use FORMAT like sprintf?? [message #32235] Wed, 25 September 2002 00:32
Brian Huether is currently offline  Brian Huether
Messages: 12
Registered: September 2002
Junior Member
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:

thanks,

brian

--------------------------------------------------
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
Previous Topic: What's better: 1 big HDF file or several samller ones??
Next Topic: Re: travelling idl license - rsi -"NO DICE"

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

Current Time: Wed Oct 08 18:43:10 PDT 2025

Total time taken to generate the page: 0.00388 seconds