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

Home » Public Forums » archive » Re: String/integer use in variable definitions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: String/integer use in variable definitions [message #21680] Wed, 13 September 2000 08:47
promashkin is currently offline  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 Go to previous message
promashkin is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: axis labels
Next Topic: Re: Quick array question

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

Current Time: Wed Oct 08 13:51:20 PDT 2025

Total time taken to generate the page: 0.00600 seconds