|
Re: check envi status [message #67062 is a reply to message #67057] |
Wed, 24 June 2009 07:33  |
KRDean
Messages: 69 Registered: July 2006
|
Member |
|
|
On Jun 24, 2:45 am, chris <rog...@googlemail.com> wrote:
> Hi,
> how can someone check within IDL whether envi is installed and is
> running in the background? I can't find any information on that. Can
> somebody help?
>
> Best regards
>
> CR
Simple enough. Use CATCH. If ENVI is NOT install, the CATCH will
"catch" the error.
;+
;
; @examples
; <PRE>
; IDL> PRINT, ' ENVI is ', ( Simple_ENVI_On() ) ? 'Available' : 'Not
Available'
; </PRE>
;
;----------------------------------------------------------- ------------
FUNCTION Simple_ENVI_ON
CATCH, ERROR_STATUS
IF Error_status NE 0 THEN BEGIN
PRINT, 'Error index: ', Error_status
PRINT, 'Error message: ', !ERROR_STATE.MSG
CATCH, /CANCEL
RETURN, 0
ENDIF
ENVI, /Restore_Base_Save_Files
RETURN, 1
END
Kelly Dean
Fort Collins, Colorado
|
|
|