Quote:
$importfile = loadfile(@scriptdir + '\090420.csv')
$i_array = quicksort($importfile,0)


The loadfile UDF I found can load a file into an array ir directly into a variable. You did not post your UDF code so I can not determine if you intended read the file into a variable or into an array. However, the quicksort UDF is used as if you expected that $importfile was an array.

 Code:
Function loadfile($file, optional $array, $Uni)
	DIM $fso,$f,$fs
	if $uni $uni = $uni-3 else $uni = -2 endif

	if not $uni $uni = -2 endif
	$fso = CreateObject("Scripting.FileSystemObject")
	$f = $fso.GetFile($file)
	If @ERROR Exit 2 EndIf
	$fs = $f.OpenAsTextStream(1,$uni)
	if not $array
		$loadfile = $fs.Read($f.size)
	else
		$loadfile = Split($fs.Read($f.size),$array)
	endif
	Exit @ERROR 
EndFunction
 

 Code:
function quicksort($a, optional $indexcol )
    ;$a                        array to be sorted 
    ;$indexcol                 index of subitem to sort on 
 
_________________________
Home page: http://www.kixhelp.com/hb/