System Variables & .sav files [message #40221] |
Mon, 26 July 2004 13:52  |
hyperjiver
Messages: 10 Registered: July 2004
|
Junior Member |
|
|
Hello -
I am trying to create a stand alone application from a an extensive
program that is used for image processing. The part I am trying to
work on now is the part where the user chooses the default directory.
I have this application working from the IDL window or the command
prompt, but when I try to run it through the .sav file I create (after
Resolve_All & also compiling other programs that are not explicitly
called), I get a Run time error 'Not a legal system variable'. I have
a seperate setup.pro program that I run to set all System variables
using DEFSYS and I am not able to figure out where I am going wrong. I
have the following questions and it will be great if you pro's can
help me with my problem. [I have been working with IDL only for the
last two weeks and I am learning as I go..., so excuse the silly
questions]
1) Do system variables have to be declared in a different way if I
intend to run a stand alone application?
2) Is there a different way to save the .sav file[I used
save,/routines, filename = "somefile.sav"] to have the system variable
definitions to be legal?
3) Has anyone here encountered similar problems and have a solution to
it?
Thank you very much for your time,
Cheers,
-HJ
|
|
|
Re: System Variables & .sav files [message #40292 is a reply to message #40221] |
Wed, 28 July 2004 07:35  |
hyperjiver
Messages: 10 Registered: July 2004
|
Junior Member |
|
|
Dear David -
BINGO! That works! Thanks a lot.. :-)
-HJ
David Fanning <davidf@dfanning.com> wrote in message news:<MPG.1b70d5d862961c399897ec@news.frii.com>...
> David Fanning writes:
>
>>> - When I try to run the macro- it works fine
>>> - When I run all these in the command prompt, it works fine
>>> - To do a standalone application, I executed all these commands in the
>>> command prompt as follows
>>>
>>> on_error,1
>>> .run setup
>>> setup
>>> .run xmanager
>>> .run main
>>> resolve_all
>>> save,/routines, filename = "filename.sav"
>>>
>>> When I run the .sav file, I get an error - '!MY_dir is not a legal
>>> system variable'
>>
>> Oh, dear. :-(
>>
>> I have to admit there are days when after 16+ years
>> of working with IDL I think I have seen it all. But
>> this setup completely and utterly baffles me. I've never
>> seen the like. :-)
>>
>> As far as I can see the issue is not why this DOESN'T
>> run as a stand-alone application, but why it DOES
>> run in any other configuration!
>
> After taking a shower and thinking about it a bit
> more, I have a theory. :-)
>
> I think what is happening is that only the MAIN
> procedure is getting saved, with NO system variables
> set. That's where the error comes from.
>
> Try this. Put the SETUP call in the MAIN routine
> on the first line after the procedure definition
> statement. Something like this"
>
> PRO Main
> SETUP
> ...
> END
>
> Then do this in a new IDL session:
>
> IDL> .compile main
> IDL> resolve_all
> IDL> Save, /Routines, Filename='main.sav'
>
> Exit IDL, and double click "main.sav". Does *that*
> work?
>
> Cheers,
>
> David
>
> P.S. Let's just say seeing that ol' XManager call
> out there all by his lonesome just gives me the
> shivers!!
|
|
|