Re: String/integer use in variable definitions [message #21680] |
Wed, 13 September 2000 08:47 |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
Sorry, Execute is a function. It will look like this:
for i=0, X do $
junk=execute('test[*,*,i] = sub'+strcompress(i+1, /rem))
Not enough coffe yet. I am working on it :-)
Cheers,
Pavel
Pavel Romashkin wrote:
> ...
> your goal can be accomplished using Execute procedure:
>
> for i=0, X do $
> execute, 'test[*,*,i] = sub'+strcompress(i+1, /rem)"
|
|
|
Re: String/integer use in variable definitions [message #21681 is a reply to message #21680] |
Wed, 13 September 2000 08:44  |
promashkin
Messages: 169 Registered: December 1999
|
Senior Member |
|
|
"S. Penzes" wrote:
> If I have a bunch of variables named sub1,sub2 ... subn with dimensions
> [x,y] and another variable named "test" with dimensions [x,y,n]. What
> is the syntax to have test[*,*,i] set to sub1, sub2, etc in a do loop?
If you already have your code producing disorganized variables named
Sub*, your goal can be accomplished using Execute procedure:
for i=0, X do $
execute, 'test[*,*,i] = sub'+strcompress(i+1, /rem)
However, I would recommend reorganizing the code to avoid having to use
variable names like that.
Cheers,
Pavel
|
|
|