Re: test for ENVI running in IDL code [message #41851] |
Tue, 07 December 2004 05:45 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
enod writes:
> There may be a little trouble. What will happen if only IDL is running?
> The function envi_real_main_base() will not be available.
Well, I think that is pretty much the *point* of Peter's
little piece of code. :-)
Cheers,
David
P.S. Tip to Peter: It doesn't pay to be subtle when posting
to public forums. Better to just spell it out, even if the
code looks clunky. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: test for ENVI running in IDL code [message #41853 is a reply to message #41851] |
Tue, 07 December 2004 05:05  |
timothy.williams
Messages: 20 Registered: October 2001
|
Junior Member |
|
|
enod wrote:
> There may be a little trouble. What will happen if only IDL is
running?
> The function envi_real_main_base() will not be available. To check if
> one function is loaded, you can issue a HELP command:
>
> help,name='envi_open_file',/routines,output=output
>
> Search the *output* variable for "envi_open_file" function and then
you
> can figure out if ENVI is running.
>
> Tian.
>
> P.S. It seems that envi_real_main_base is not listed in ENVI help
> document, so the check of it could result in failure.
Exactly my point. I like the idea of using HELP. I'll give it a try.
Thanks.
|
|
|
Re: test for ENVI running in IDL code [message #41854 is a reply to message #41853] |
Tue, 07 December 2004 05:03  |
timothy.williams
Messages: 20 Registered: October 2001
|
Junior Member |
|
|
enod wrote:
> There may be a little trouble. What will happen if only IDL is
running?
> The function envi_real_main_base() will not be available. To check if
> one function is loaded, you can issue a HELP command:
>
> help,name='envi_open_file',/routines,output=output
>
> Search the *output* variable for "envi_open_file" function and then
you
> can figure out if ENVI is running.
>
> Tian.
>
> P.S. It seems that envi_real_main_base is not listed in ENVI help
> document, so the check of it could result in failure.
Exactly my point. I like the idea of using HELP. I'll give it a try.
Thanks.
|
|
|
Re: test for ENVI running in IDL code [message #41855 is a reply to message #41854] |
Tue, 07 December 2004 05:04  |
timothy.williams
Messages: 20 Registered: October 2001
|
Junior Member |
|
|
enod wrote:
> There may be a little trouble. What will happen if only IDL is
running?
> The function envi_real_main_base() will not be available. To check if
> one function is loaded, you can issue a HELP command:
>
> help,name='envi_open_file',/routines,output=output
>
> Search the *output* variable for "envi_open_file" function and then
you
> can figure out if ENVI is running.
>
> Tian.
>
> P.S. It seems that envi_real_main_base is not listed in ENVI help
> document, so the check of it could result in failure.
Exactly my point. I like the idea of using HELP. I'll give it a try.
Thanks.
|
|
|
Re: test for ENVI running in IDL code [message #41859 is a reply to message #41854] |
Mon, 06 December 2004 22:52  |
enod
Messages: 41 Registered: November 2004
|
Member |
|
|
There may be a little trouble. What will happen if only IDL is running?
The function envi_real_main_base() will not be available. To check if
one function is loaded, you can issue a HELP command:
help,name='envi_open_file',/routines,output=output
Search the *output* variable for "envi_open_file" function and then you
can figure out if ENVI is running.
Tian.
P.S. It seems that envi_real_main_base is not listed in ENVI help
document, so the check of it could result in failure.
|
|
|
Re: test for ENVI running in IDL code [message #41869 is a reply to message #41859] |
Mon, 06 December 2004 15:18  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
timothy.williams@nvl.army.mil wrote:
> Is there a way to check to see if ENVI is already running from IDL?
> I'm writing an application that uses ENVI (6.1) and I want to be sure
> that envi is running before I start calling ENVI_* routines.
>
> Thanks.
Hi Timothy,
There's probably a better way and the following function is a bit brutal,
but it works:
forward_function envi_real_main_base
function enviloaded, nothing
catch, e
if keyword_set(e) then return, 0
return, widget_info( envi_real_main_base(), /valid )
end
Cheers
Peter Mason.
|
|
|