;+
; Project     :	SOLAR-B - EIS
;
; Name        :	EIS_CPT_FIRST
;
; Purpose     :	Checks if first call with this string argument.
;
; Explanation : Checks if first call with this string argument.
;
; Use         :	< res = eis_cpt_first(str) >
;
; Inputs      :	str : STRING argument
;
; Opt. Inputs : None.
;
; Outputs     : res : INT
;                       0 : called previously
;                       1 : first call
;
; Opt. Outputs:	None.
;
; Keywords    : RESET : resets list of strings
;
; Calls       : None.
;
; Common      :	EIS_CPT_STRING_COMMON.
;
; Restrictions:	None.
;
; Side effects:	None.
;
; Category    :	EIS_CPT.
;
; Prev. Hist. :	None.
;
; Written     :	Martin Carter RAL 01/10/08
;
; Modified    : Version 0.0, 01/10/08, MKC
;
; Version     :	0.0, 01/10/08
;-
;**********************************************************

FUNCTION eis_cpt_first, str, RESET=reset

  COMMON EIS_CPT_STRING_COMMON, list

  ; check if reset

  IF KEYWORD_SET(reset) THEN eis_cpt_undefine, list

  ; check if argument set

  IF N_ELEMENTS(str) EQ 0 THEN RETURN, 0

  ; check if list not yet set up

  IF N_ELEMENTS(list) EQ 0 THEN BEGIN

    list = str

    RETURN, 1

  ENDIF

  ; check if str in list

  dummy = WHERE(list EQ str, count)

  IF count EQ 0 THEN BEGIN

    ; add str to list

    eis_cpt_add, list, str

    RETURN, 1

  ENDIF ELSE BEGIN

    ; str in list

    RETURN, 0

  ENDELSE

END





