;+
; Project     :	SOLAR-B - EIS
;
; Name        :	EIS_CPT_READ_TEXT
;
; Purpose     :	Reads STRARR from file specified by logical unit.
;
; Explanation : Reads STRARR from file specified by logical unit.
;
; Use         :	< res = eis_cpt_read_text(unit,text) >
;
; Inputs      :	unit : LONG logical unit number
;
; Opt. Inputs : None.
;
; Outputs     : res  : INT flag indicating result
;                        1 : ok
;                        0 : not ok
;               text : STRARR text data
;
; Opt. Outputs:	None.
;
; Keywords    : None.
;
; Calls       : None.
;
; Common      :	None.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	EIS_CPT.
;
; Prev. Hist. :	None.
;
; Written     :	Martin Carter RAL 03/10/05
;
; Modified    :	Version 0.0, 03/10/05, MKC
;
; Version     :	Version 0.0, 03/10/05
;-
;**********************************************************

FUNCTION eis_cpt_read_text, unit, text

  ; set io error action

  ON_IOERROR, io_error

  ; set up input variable

  buffer = ''

  ; read text

  WHILE NOT EOF(unit) DO BEGIN

    READF, unit, buffer

    eis_cpt_add, text, buffer

  ENDWHILE

  ; return ok

  RETURN, 1

io_error :

  ; issue routine name

  MESSAGE, 'ERROR', /INFORMATIONAL

  ; return error

  eis_cpt_message, 'IO ERROR reading from file'

  RETURN, 0

END





