;------------------------------------------------------------------------------;
;+
; NAME
;		         EIS_CHECK_ZDBASE
; PURPOSE
;           This function checks that both environment variables ZDBASE_USER
;           and ZDBASE have been defined
; NOTES
;           This function is called by eis_mk_raster, eis_mk_study and
;           eis_mk_plan - if it returns zero (it has failed) - then these
;           GUIs are not invoked!
; INPUTS
;           None
; WRITTEN
;           John A Rainnie, RAL, 26-Jan-2007
; HISTORY
;               
;-
;------------------------------------------------------------------------------;
FUNCTION eis_check_zdbase

; Are both the USER and OFFICIAL ZDBASE environment variables defined?

;
; USER
;
zdbase_user     = GETENV('ZDBASE_USER')
IF (STRLEN(zdbase_user[0]) EQ 0) THEN BEGIN
    BEEP
    print,'************************************************'
    print,''
    print,' ZDBASE_USER is undefined.....aborting!'
    print,''
    print,'************************************************'
    RETURN , 0
ENDIF

;
; OFFICIAL
;
zdbase_official = GETENV('ZDBASE_EIS')
IF (STRLEN(zdbase_official[0]) EQ 0) THEN BEGIN
    BEEP
    print,'************************************************'
    print,''
    print,' ZDBASE_EIS.....aborting!'
    print,''
    print,'************************************************'
    RETURN , 0
ENDIF

RETURN , 1

END
