I've used this, I've never ran into a problem with it. The Assert is there to prevent some buggy things from happening.
Code:
Function CheckArray(MyInt() As Integer) As Boolean
Dim i As Long
i = Not Not MyInt
Debug.Assert App.hInstance
If Not i = 0 Then
CheckArray = True
Else
CheckArray = False
End If
End Function
Usage:
Code:
Sub TestSub()
Dim MyInt1() As Integer, MyInt2() As Integer
ReDim MyInt2(3 To 5)
MsgBox CheckArray(MyInt1) 'Return False, the Array IS NOT initialized
MsgBox CheckArray(MyInt2) ' Return True, the array IS initialized
End Sub
Well, it works, but what buggy things do you mean?
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)