You can use UBound to determine the size of an array. I want to that that to an array returned as a result of a function, but then I get the error Invalid procedure call. This is the (simplified) function:
Public Function GetCheckBlocks(fileName)
Dim counter, checkBlocks
Set checkBlocks = CreateObject( "System.Collections.ArrayList" )
For counter = 0 To 10
checkBlocks.Add counter
Next
Set GetCheckBlocks = checkBlocks
End Function
And here is the way I call the function and want to get the size of the array:
Dim expectedChecks, expectedFile
expectedFile = "test.txt"
Set expectedChecks = GetCheckBlocks(expectedFile)
MsgBox UBound(expectedChecks)
What is wrong here and how do I get the size of the returned array?