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

Home » Public Forums » archive » defsysv
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: defsysv [message #7898 is a reply to message #7777] Fri, 17 January 1997 00:00 Go to previous message
Peter Mason is currently offline  Peter Mason
Messages: 145
Registered: June 1996
Senior Member
On Wed, 15 Jan 1997, Jeff Hall wrote:
> Why does this work on the command line
>
> IDL> defsysv, '!jeff', 38
> IDL> print, !jeff
>
> when this doesn't work as a pro?
>
> pro test
> defsysv, '!jeff', 38
> print, !jeff
> end

I think this comes down to another strange "feature" in the IDL compiler:
It seems that IDL recognises system variables at COMPILATION time.
In your routine, !jeff is undefined at compilation time; this is
detected and IDL stops with an error message on the line "print, !jeff".
(!jeff only gets defined at runtime.)

A sort-of way out is to have a routine which defines system variables but
doesn't do anything else with them, and call it before any routine which uses
these system variables is compiled.
More simply, define all of your custom system variables at IDL startup (e.g.,
in a startup file). Then you can reassign their values in your programs
(e.g., !jeff=38).


Peter Mason
[Message index]
 
Read Message
Read Message
Previous Topic: Re: IDL 4.0.1 - Windows NT 4.0
Next Topic: calling a user-named procedure

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

Current Time: Sat Oct 11 23:30:40 PDT 2025

Total time taken to generate the page: 2.15801 seconds