Re: screwy system variables !? [message #6601] |
Thu, 25 July 1996 00:00 |
landsman
Messages: 93 Registered: August 1991
|
Member |
|
|
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
|
|
|