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

Home » Public Forums » archive » Re: IDL- variable variable 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: IDL- variable variable names [message #7375 is a reply to message #7372] Thu, 07 November 1996 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
I wrote in a previous article:

> But..., I got about this close:
>
> FUNCTION MAGIC, file
> number = 0
> ok = EXECUTE(file + ' = 0')
> RESTORE, file
> RETURN, number
> END
>
> IDL> a = 10
> IDL> number = a
> IDL> Save, a, number, Filename='a'
> IDL> b = 'a'
> IDL> c = Magic(b)
> IDL> IF c EQ 10 THEN Print, "It's magic!"
>
> It's magic!

Here is an obvious modification that I overlooked that nudges it
even closer. And I added some help for the 8.3 crowd! :-)

FUNCTION MAGIC, file
number = 0
RESTORE, file + '.sav'
RETURN, number
END

IDL> a = 10
IDL> number = a
IDL> Save, number, Filename='a.sav'
IDL> b = 'a'
IDL> c = Magic(b)
IDL> IF c EQ 10 THEN Print, "It's magic!"

It's magic!

This almost borders on the useful now. What do you have
in mind for this, Hendrik?

David

*************************************************
* David Fanning, Ph.D.
* 2642 Bradbury Court, Fort Collins, CO 80521
* Phone: 970-221-0438 Fax: 970-221-4762
* E-Mail: davidf@dfanning.com
*
* Sometimes I go about pitying myself, and all along my
* soul is being blown by great winds across the sky.
* -- Ojibway saying
************************************************
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Plotting the terminator on a map
Next Topic: Re: using of EXECUTE???

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

Current Time: Sat Nov 29 16:08:20 PST 2025

Total time taken to generate the page: 0.00299 seconds