|
Public Function ReDimPreserveVariantMatrix( _
ByRef rMatrix() As Variant _
, Optional ByVal vLBound1 As Variant _
, Optional ByVal vUBound1 As Variant _
, Optional ByVal vLBound2 As Variant _
, Optional ByVal vUBound2 As Variant _
) As Boolean Assuming
Dim avarNums() As Variant
ReDim avarNums(0 To 5, 0 To 10)
avarNums(1, 1) = .45
avarNums(2, 3) = .12
' ....
for example
' Same as ReDim Preserve avarNums(-5 To 10, 0 To 10)
' if Visual Basic would allow it.
ReDimPreserveVariantMatrix(avarNums(), -5, 10) = True
leaves
avarNums(1, 1) = .45
avarNums(2, 3) = .12
' Etc.See also: ReDimPreserveVariantCube Function
ReDimPreserveVariantVector Function
BasicExtensions Class
ReDim Preserve Statement (Visual Basic)rMatrix: Dynamic, two-dimensional array of Variant values that will be redimensioned. rMatrix must already be dimensioned before it is passed to this function or else an error will occur. Copyright © 1999-2005 Entisoft