| Re: working with restored values [message #11132 is a reply to message #11131] |
Mon, 02 March 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Cathy Campo (campo@gav.gat.com) writes:
> I am restoring a large save file, and displaying some of the
> variable names to the user to choose from in a droplist.
>
> restore, 'junk.sav'
> help, output=tmpstr
> varlist = strarr(5)
> varlist = tmpstr(0:4)
> widget_control, droplist, set_value=varlist
>
> i would like to save the actual values of the variables in a pointer
> array or structure. (have this be the uvalue of the droplist?)
> but how would i do this?
>
> later i would be using the pointer array or structure in the event
> loop of the droplist to do calculations with the value chosen.
I presume from this that you do NOT know the names of the
variables in advance. I would try something like this:
varValues = FltArr(5)
For j=0,4 DO ok = Execute('varValues[j] = ' + varlist[j])
Widget_Control, droplist, Set_Value=varlist, Set_UValue=varValues
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
|