Try this...

$abc = someudf(1)
For Each $element in $abc
"element > " + $element
Next




Function someudf($somevar)
Dim $somearray[4]
Select
Case $somevar = 1
$somearray[0] = "someval"
$somearray[1] = "someotherval"
$somearray[2] = "anotherval"
$somearray[3] = "yetanotherval"
$someudf=$somearray

Case $somevar = 2
$somearray[0] = "differentval"
$somearray[1] = "differentvalagain"
$somearray[2] = "anotherval"
$somearray[3] = "yetanotherval"
$someudf=$somearray

EndSelect
EndFunction


You really can't dim $someudf because it's the name of the UDF and is "automagically" dimmed by kixtart.
_________________________
(... better days ahead)