Error on line 65? There is no line 65 in the code you posted.

Here is more logical rewrite of your code.
InArry is not a build inn kixtart function. Are you using a UDF or something? If not you should use ascan (see example).

Open(3,$csv) = 0 is also not valid. I changed it to If Open(3,$csv) = 0 and added an else statement and an endif.

I cant test because I do not know your setup and the content of the csv file but this is closer to a working solution imho.

 Code:
$csv="C:\temp\test.csv"

If Open(3,$csv) = 0
	$count1 = 0
	$RL = ReadLine(3)
  	While NOT @ERROR
		$Bits = Split($RL,"|")
  		If ASCAN($array, $bits[1]) = "-1"
  			$array[$count1] = $Bits[1]
  			$array2[$count1] = $Bits[66]
  			$Count1 = $Count1 + 1
  		EndIf
  		$RL = ReadLine(3)
 	Loop
	For Each $Value In $Array2
  		$sum = $sum + $value
	Next
Else
	?"There was an error opening the csv file."
	?@ERROR " - " @SERROR
EndIf
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.