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

Home » Public Forums » archive » Re: how to link the strname with the same name of variables
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: how to link the strname with the same name of variables [message #67273 is a reply to message #67272] Tue, 14 July 2009 06:23 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
mengran wrote:
> Hi,everyone.
>
> I want to output a batch of variables to different files, and the
> variable names like c1, c2,c3,,,,. I use the arrstring to save the
> variable names and get the real variable data from different bands of
> a image. The problem confused me is that it is not possible to output
> the variable in a for loop, although the elements of strarr have the
> same name as the true variable names. There must be some skills that I
> do not know, could you tell them to me please?Thanks a lot!
> best wishes,
> mengran


Hi,

ok, you have 2 solutions. The first one is to create an array holding
your c's values... so you have c1 = fltarr(x,y), c2 = fltarr(x,y) etc,
you would end up with c = fltarr(x,y,nbBands). Then you can use C in
your loop (writeu, lun, c[*,*,i]) . Alternatively, you can use an array
of pointers (if you don't have enough memory).

Otherwise, have a look at SCOPE_VARFETCH It will allow you to retrieve
the content of your variable.

Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: file_info not detecting write-protected files under windows (bug?)
Next Topic: how to link the strname with the same name of variables

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

Current Time: Wed Oct 08 18:22:47 PDT 2025

Total time taken to generate the page: 0.00307 seconds