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

Home » Public Forums » archive » screwy system variables !? [2]
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: screwy system variables !? [message #6606 is a reply to message #6602] Thu, 25 July 1996 00:00 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
landsman@sorbet.gsfc.nasa.gov (Wayne Landsman (301)-286-3625) writes:

> In article <4t714c$lf2@senator-bedfellow.MIT.EDU>, trujillo@xnmusc.mit.edu (Chad Trujillo) writes...
>> It seems like I can't actually create new system variables in a
>> function or program and use them later in that same function/program.
>> For example, I have the following program (in file tester.pro):
>> pro tester
>> defsysv, "!tester", 222
>> print, !tester ;this line directly refers to !tester
>> end

>> When I try to compile/run it, I get the following error (unless I
>> manually define !tester at the command line first):
>> % Not a legal system variable: !TESTER.

> You want to have all references to !TESTER in quotes so that the compiler
> won't reject the system variable before the DEFSYSV call is executed. One
> way to do this is as follows:

> pro tester
> status = execute('defsysv, "!tester", 222')
> status = execute('print, !tester')
> end

> Presumably you would want a short program that compiles the necessary
> system variables as the first procedure to be compiled.

> --Wayne Landsman landsman@sorbet.gsfc.nasa.gov

Another way to get around this problem is to put the call to DEFSYSV in your
IDL startup procedure (given by the environment variable IDL_STARTUP). That
way, it'll be guaranteed to be defined before you try to use it, and you won't
need to use calls to EXECUTE.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: screwy system variables !?
Next Topic: a BUG or not a BUG in IDL ?

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

Current Time: Sat Oct 11 09:21:57 PDT 2025

Total time taken to generate the page: 0.88459 seconds