Please read the FAQ Forum under How to write a UDF .

Basically, you can return only one variable from a UDF. However, you can return an array of values as a variable. The UDF Library contains lots of examples that return arrays.

Example
code:
$a=filesplit('c:\winnt\system32\kixforms.dll')
for each $b in $a
? 'Folder/file = '+$b
next
function filesplit($file)
$filesplit=split($file,'\')
endfunction

_________________________
There are two types of vessels, submarines and targets.