Re: Is there a work around to save multiple variables with same head but different tails without listing all of them? [message #77878] |
Thu, 29 September 2011 07:46  |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Sep 29, 10:16 am, voidspace <jhkim...@gmail.com> wrote:
> On 9월29일, 오후9시50분, greg.a...@googlemail.com wrote:
>
>> Although you can use tricks like this to do what you need, you would almost certainly have been better off to define your variables as arrays in the first place, and refer to them by their indices...
>
>> e.g.
>> sst_cccma_cgcm3[i]
>
>> Otherwise, you'll meet the same problem every time you want to do anything at all with their values (plot them, for example)
>
>> good luck!
>> Greg
>
> Thanks, Greg. Exactly. In fact I could put all different variables
> into one defined variable and save all of them in one array variable.
> This is certainly much better way. But today I had a good exercise
> about the string manipulation in IDL. Cheers, John
My guess is the poster's variables are arrays with varying size. I
used integers for simplicity in the example. In the case of arrays,
you're better off using a structure of arrays.
|
|
|