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

Home » Public Forums » archive » Re: Is there a work around to save multiple variables with same head but different tails without listing all of them?
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: Is there a work around to save multiple variables with same head but different tails without listing all of them? [message #77884 is a reply to message #77883] Thu, 29 September 2011 06:34 Go to previous messageGo to previous message
voidspace is currently offline  voidspace
Messages: 4
Registered: September 2011
Junior Member
This is my test for an example for Dave..

Dear Brian (and Dave for an example),

It really worked with a minor bug fixing! Really simple and powerful
function that I didn't know.

I tried printing first and got the variable names concatenated by
comma that I wanted to produce.

IDL> print,strJoin(sst,',',/Single)

sst_cccma_cgcm3_1,sst_cnrm_cm3,sst_csiro_mk3_0,sst_gfdl_cm2_ 0,sst_gfdl_cm2_1,sst_iap_fgoals1_0_g,sst_inmcm3_0,sst_ipsl_c m4,sst_miroc3_2_medres,sst_mpi_echam5,sst_mri_cgcm2_3_2a,sst _ncar_ccsm3_0,sst_ncar_pcm1,sst_ukmo_hadcm3,sst_ukmo_hadgem1

Then, I tried first without 'EXECUTE' function because Brian's
suggestion doesn't look require it.

IDL> SAVE, FILENAME='sst_cmip3_20c3m.sav', strJoin(sst,',',/Single)
% SAVE: Expression must be named variable in this context: <STRING
('sst_cccma_cgcm3_1,ss...')>.

It didn't work! So I tried with 'EXECUTE' function following Brian's
suggestion, but got the same error message.


IDL> result=EXECUTE("SAVE, FILENAME='sst_cmip3_20c3m.sav',
strJoin(sst,',',/Single)")
% SAVE: Expression must be named variable in this context: <STRING
('sst_cccma_cgcm3_1,ss...')>.

Then, I thought that strJoin(sst,',',/Single) part should be outside
of quotation marks according to the error message.

Tried the following and got exactly what I wanted!

IDL> result=EXECUTE("SAVE,
FILENAME='sst_cmip3_20c3m.sav',"+strJoin(sst,',',/Single))

Thank you very much for your help, Brian!

Cheers,
John
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using PS_START to create A4 Landscape postscript?
Next Topic: Re: Saving via ImageMagick with Coyote Routines fails

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

Current Time: Wed Oct 08 22:29:27 PDT 2025

Total time taken to generate the page: 0.96136 seconds