Could be a number of reasons, but Uniq() (if that's the UDF that you are using) doesn't sanity check the input and will generate an out of bounds error if you don't pass an array.

In this example the first call correctly removed the duplicate "ccc" entry, the second call handles the single element array OK, but the third call which has a simple strin causes an error:
 Code:
Join(Uniq(Split("aaa bbb ccc ccc ddd")))+@CRLF
Join(Uniq(SPlit("aaa")))+@CRLF
Join(Uniq("aaa"))+@CRLF



;;
;;======================================================================
;;
;;FUNCTION       uniq()
;;
;;ACTION         Removes duplicates from a sorted, 1-dimension array
;;
;;AUTHOR         Glenn Barnas / FRIT-EROC
;;
;;SYNTAX         uniq(array)
;;
;;PARAMETERS     array - array to remove duplicates from
;;
;;REMARKS        Array must be sorted first - no check for sort is performed
;;
;;RETURNS        array with duplicate items removed
;;
;;DEPENDENCIES   none
;;
;;TESTED WITH    NT4, W2K, WXP
;;
;;EXAMPLES       $Singles = Uniq($has_dups)
;
Function Uniq($A)

  ; $TOP is last entry, $X is source pointer, $Y is destination pointer
  Dim $Top, $X, $Y
  $Top = UBound($A)             ; Find size of original array
  Dim $WA[$Top]                 ; Create working array

  $Y = 1                        ; output array pointer
  $WA[0] = CStr($A[0])          ; copy first element
  For $X = 1 to $Top
    If $WA[$Y - 1] <> $A[$X]    ; is current value different from last?
      $WA[$Y] = CStr($A[$X])    ; add it to output
      $Y = $Y + 1               ; increment output pointer
    EndIf
  Next

  ReDim Preserve $WA[$Y - 1]    ; resize output array
  $Uniq = $WA                   ; return the array of unique elements

EndFunction


 Quote:
D:\temp>kix32 uniq.kix
aaa bbb ccc ddd
aaa

ERROR : array reference out of bounds!
Script: D:\temp\uniq.kix
Line : 37