I've used this, I've never ran into a problem with it. The Assert is there to prevent some buggy things from happening.
Usage: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
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




Reply With Quote