Hello,

I'm having a bit of trouble grasping just how functions return values, namely arrays.

The below code does not work it when running the script, the function does not correctly return an array, why??:

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


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


Thanks in advance,

Luke