<-- Previous || Up || Next -->

Variant Vector To Matrix Column Function
Array Conversions Class

Public Function VariantVectorToMatrixColumn( _
      ByRef rTo() As Variant _
    , ByRef vFm() As Variant _
    , ByVal vColumnNumber As Variant _
    ) As Boolean

Overlays a one-dimensional Variant array onto a Column of a two-dimensional Variant array.
The destination array must already have been dimensioned.

Summary:
    rTo(ColumnNumber, X) = vFm(X)
Example:
    Assuming
       Static avarTable(0 To 2, 0 To 2) As Variant
       ' Column--v  v--Row
       avarTable(1, 1) = "From"
       avarTable(2, 1) = "feet"
       avarTable(1, 2) = "To"
       avarTable(2, 2) = "meters"
       Static avarNew(1 To 2) As Variant
       avarNew(1) = "gallons"
       avarNew(2) = "liters"
    for example
       ? VariantVectorToMatrixColumn(avarTable(), avarNew(), 2)
       True
       ? VariantMatrixToString(avarTable(), " ", vbCrLf)
       From gallons
       To liters
See also:
    VariantMatrixColumnToVector Function (near inverse)
    VariantVectorToMatrixRow Function
rTo: Two-dimensional array of Variants in which one of the columns will be overlaid by vFm. Within this array, dimension #1 represents the Column and dimension #2 represents the Row. This is because the number of rows changes most frequently and the upper bound of the last dimension (representing the row) can be re-dimensioned directly by Visual Basic.
vFm: One-dimensional Variant array containing the values that will replace the column in rTo.
vColumnNumber: Number of the Column in rTo whose values will be replaced.
Return value: Function does nothing and returns False if vColumnNumber is Null or cannot be fixed-up to a number. Function currently returns True in all other cases.

Return to ENTISOFT Home Page

Copyright 1999-2005 Entisoft