public type selfDef
a as string
b as integer
end type
dim testArr() as selfDef
testArr=testFunction
msgbox ubound(textArr)
public function testFunction() as selfDef()
'to do
redim testFunction(20) as selfDef
testFunction(0).a="a"
textfunction(0).b=1
'......
'end to do
end Function
public type selfDef
a as strin
b as integer
end type
public function TestFunction() as selfDef()
dim i as integer,j as integer
i=inputbox("Input a number:")
dim tempD() as selfDef
for j=0 to i-1
redim preserve tempD(i) as selfDef
tempD(j).a="AAA"
tempD(j).b=3
next
testfunction = selfDef
end function