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

Home » Public Forums » archive » Re: SAVE again
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: SAVE again [message #71019] Tue, 25 May 2010 23:54 Go to previous message
Gray is currently offline  Gray
Messages: 253
Registered: February 2010
Senior Member
On May 25, 9:18 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> On May 25, 5:45 pm, pp <pp.pente...@gmail.com> wrote:
>
>
>
>
>
>> On May 25, 9:05 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
>
>>> Is it possible to simplify this line:
>
>>> save, v1, v2, v3, v4, v5,...,v100, filename = 'xxx..sav'
>
>>> by using something like this:
>
>>> for j=1,100 do print, 'v'+strtrim(string(j),1)+','
>
>>> ... so I don't have to write down "v" a hundred times?
>
>> Possible, yes. But that is not your problem. Your code really should
>> not have 100 variables called vxxx. It is a nightmare to read and to
>> edit.
>
>> Why don't you put all that stuff into a single array?
>
> Hi pp,
>
> Yes, I know... this is a bad example. I don't actually have 100
> variables called vxxx. Just wanted to know if there is a way to pass
> the variable names to be saved other than typing each name and passing
> them as parameters on the line. I think CMSAVE will do it... thanks,
> Craig!

You can automate actions with multiple variations of the same filename
by using EXECUTE. Thus, in this example, you would want to do
something like:
vars = strjoin('v'+strtrim(indgen(100)+1,1),',')
fname = string(39B)+'xxx.sav'+string(39B)
status = EXECUTE('save, '+vars+', filename='+fname)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: rotate tickname and titles
Next Topic: Re: Matching data in different time resolution

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

Current Time: Wed Oct 08 19:12:48 PDT 2025

Total time taken to generate the page: 0.00455 seconds