;+
; Project     :	SOLAR-B - EIS
;
; Name        :	EIS_CPT_WRITE_TEXT
;
; Purpose     :	Writes STRARR to file specified by logical unit.
;
; Explanation : Writes STRARR to file specified by logical unit.
;
; Use         :	< res = eis_cpt_write_text(unit,text) >
;
; Inputs      :	unit : LONG logical unit number
;               text : STRARR text data
;
; Opt. Inputs : None.
;
; Outputs     : res  : INT flag indicating result
;                        1 : ok
;                        0 : not ok
;
; Opt. Outputs:	None.
;
; Keywords    : None.
;
; Calls       : None.
;
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	EIS_CPT.
;
; Prev. Hist. :	None.
;
; Written     :	Martin Carter RAL 21/10/04
;
; Modified    :	Version 0.0, 21/10/04, MKC
;
; Version     :	Version 0.0, 21/10/04
;-
;**********************************************************

FUNCTION eis_cpt_write_text, unit, text

  ; set io error action

  ON_IOERROR, io_error

  ; write text

  FOR l = 0, N_ELEMENTS(text)-1 DO BEGIN

    PRINTF, unit, text[l]

  ENDFOR

  ; return ok

  RETURN, 1

io_error :

  ; issue routine name

  MESSAGE, 'ERROR', /INFORMATIONAL

  ; return error

  eis_cpt_message, 'IO ERROR writing to file'

  RETURN, 0

END





