pro	edt,file
;+
; NAME:
;	EDT
; PURPOSE:
;	Calls the shared image of EDT
; CALLING SEQUENCE:  
;	EDT,file_name
; INPUTS:
;	file_name	Name of file to be edited as a string
;			This is checked for certain typos
; OUTPUTS:
;	
; OPTIONAL OUTPUTS:
;
; RESTRICTIONS:
;	Although the routine checks for typos, if an error occurs in
;	EDT, then it is impossible to call this routine because of
;	an error in EDT. IDL must be exited to correct this situation.
;	Spawning the command "$EDT file_name" may be better.
; PROCEDURE:
;	Calls the sharable image
; MODIFICATION HISTORY:
;	RDB	1991
;-

;>>	  First check for bad call (causes EDT to go bottom up)

;	  check if filename supplied
if n_elements(file) eq 0 then goto, bad_par

;	  check if parameter is valid
sz = size(file)
if (sz(0) ne 0) or (sz(1) ne 7) then goto, bad_par

;	  check for silly filename (eg. cc.cc.cc)
nstart=0		;only checks '.' after the [...]
if strpos(file,'[') gt -1 then  nstart = strpos(file,']')+1
bfile = byte(file)
ndot = where(bfile(nstart:*) eq 46)	;find '.'s
if n_elements(ndot) gt 1 then goto, bad_par


;>>	  all OK, call EDT

status = call_external('edtshr','edt$edit',file)
return

;>>	  error of some kind found
bad_par:
	print,"Usage: EDT, 'filename'"
	return
	end
