Skip to content

Instantly share code, notes, and snippets.

@dck-jp
Created February 17, 2014 04:59
Show Gist options
  • Save dck-jp/9045000 to your computer and use it in GitHub Desktop.
Save dck-jp/9045000 to your computer and use it in GitHub Desktop.
a part of ArrayEx.cls
Private xItems As Variant
Private xLength As Long
Private xIndex As Long
Private Sub Class_Initialize()
xIndex = -1
xLength = 32
ReDim xItems(xLength - 1)
End Sub
Private Sub Extend()
If xIndex < xLength Then GoTo Escape
xLength = xLength * 2
ReDim Preserve xItems(xLength - 1)
Escape:
End Sub
Public Function AddVal(ByVal val As Variant)
xIndex = xIndex + 1
Extend
Let xItems(xIndex) = val
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment