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

Home » Public Forums » archive » Re: accessing variables with their string names
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: accessing variables with their string names [message #10669 is a reply to message #10664] Fri, 19 December 1997 00:00 Go to previous message
Aviv Gladman is currently offline  Aviv Gladman
Messages: 8
Registered: August 1997
Junior Member
Well, i'm probably not the only one to respond to this message, but here
goes:

You can use the execute function to perform operations on string
variables. Eg:

varlist=['var1','var2','var3']

for i=0, 2 do r=execute('print,'+varlist[i])


will print the contents of var1, var2, and var3. I find this a convenient
way to add callbacks to widgets on the fly, using a linked list of
string callback function names which are executed by the event handler.

Aviv S. Gladman

On Fri, 19 Dec 1997, Natalie
Rooney wrote:

> Hello. I'm trying to create a graphical user interface to do analysis
> and plotting of research data. My widget contains a list widget where I
> display the names of the data the user has read in.
>
> The problem is: I wanted the user to be able to read in a dat file of
> saved variables. I don't know what the names of the variables will
> necessarily be. I figured out a way to get the STRING names of the
> restored variables into an array. But, I still need a way to access the
> data that the variables contain for plots, etc. Is there any way to
> access the variables' data if all you have is a string array of the
> variables' names? I'd appreciate any help.
>
> Thanks,
> Natalie Rooney
>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Vim 5 language syntax file for IDL wanted
Next Topic: bits from bytes

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

Current Time: Thu Oct 09 22:33:40 PDT 2025

Total time taken to generate the page: 0.32216 seconds