Created
February 17, 2014 04:59
-
-
Save dck-jp/9045000 to your computer and use it in GitHub Desktop.
a part of ArrayEx.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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