Hi All
This is test code
'=========================================================
Public Type Test1
t As String
i As Integer
End Type
Public Type Test2
t As String
i As Integer
l As Long
End Type
Public Tests1() As Test1
Public Tests2() As Test2
Public Function init()
ReDim Tests1(0) As Test1
ReDim Tests2(0) As Test2
End Function
'============================================
Public Function AddElement(ByRef tt As Variant, ByRef t())
Dim i As Long
Dim nArr() As Variant
ReDim nArr(0) As Variant
nArr = t
i = UBound(t) + 1
ReDim Preserve t(i)
t(i) = tt
End Function
''====================================================
'
'this function is not work. is there any way to make same job?
Public Function TestFunc()
Dim nt As Test1
Dim nt1 As Test2
Dim v As Variant
Call AddElement(nt, Tests1())
Tests2 = AddElement(nt1, Tests2())
End Function
'=========================================================
How to do make template function for AddElement ?
Thanks