;+
; NAME:
;      CUT_DUPLICATE
;
; PURPOSE:
;          To cut out consecutive duplicate entries in
;          any vector.
;
; CALLING SEQUENCE:
;          IDL> x = cut_duplicates(x)
;
; INPUTS:
;          x     -   the vector from which duplicates will be 
;                    eliminated.  String or numerical vectors allowed..
;
; OUTPUTS:
;          Function value is the cleaned vector.
;
; MODIFICATION HISTORY:
;          CDP  - written   Apr 93
;
;-

function cut_duplicates,x

xout = x
no = 0
for i=1,n_elements(x)-1 do begin
   if x(i) ne x(i-1) then begin
      no = no + 1
      xout(no) = x(i)
   endif
endfor

return,xout(0:no)

end   
