03-27-2012, 08:23 PM
Hi,
Could someone please tell me what I am doing wrong. I have a function like that return an array. I can print the array elements if I declare the MyCtrl() as a global variable. But when I try to get the array contents in a function I get an error Type Mismatch at this line 'CtrlName = MyFunction' in the calling function.
Thanks,
Sqadri
Could someone please tell me what I am doing wrong. I have a function like that return an array. I can print the array elements if I declare the MyCtrl() as a global variable. But when I try to get the array contents in a function I get an error Type Mismatch at this line 'CtrlName = MyFunction' in the calling function.
Code:
Function MyFunction
Dim MyCtrl()
MyFunction = MyCtrl
End Function
'Now access the array from the above function
Function GetCtrl
Dim CtrlName()
CtrlName = MyFunction ' get Type Mismatch at this line
for i=0 To Ubound(CtrlName)
Print CtrlName(i)
End Function
Thanks,
Sqadri