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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Previous Topic: axis labels
Next Topic: Re: Quick array question

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

Current Time: Sat Oct 11 00:53:53 PDT 2025

Total time taken to generate the page: 0.47718 seconds