Is there some reason why the IDE doesn’t allow a method to return an array of some type (or an array of objects of some class) ? Yet it is easy to do this, by defining the method as returning a variant, eg:
Public Function MakeAnArray() As Variant
var a() as integer
a.add 1
a.add 2
a.add 3
a.add 4
return a
End Function
Creating a button with the following in the “Pressed” event handler it works as expected, viz:
Var anArray() as integer
Var result as string
anArray = MakeAnArray()
for each i as integer in anArray
result = result + str(i) +" "
next
MessageBox result