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

Home » Public Forums » archive » Re: variables
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: variables [message #6719] Tue, 06 August 1996 00:00
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <4u87le$ubq@netnews.upenn.edu>, gromm@red.seas.upenn.edu (Gideon Z Romm) writes:
>
> Is there any way to convert a string into a variable name?
>
> That is, let's say I created a procedure that wants a variable name and I
> want to use a scalar of the form 'some_scalar'. Is there a way that I
> can convert it into the form that variable names expect?

You can do it using the function EXECUTE. See example below:

IDL> some_scalar = 'whatever'
IDL> val = 25.
IDL> dum = execute(some_scalar + ' = ' + string(val^2 - val))
IDL> print, whatever
600.000


Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: image printing
Next Topic: variables

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

Current Time: Sun Nov 29 03:04:48 PST 2020

Total time taken to generate the page: 0.00960 seconds