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

Variant Vector To Matrix Row Function
Array Conversions Class

Public Function VariantVectorToMatrixRow( _
      ByRef rTo() As Variant _
    , ByRef vFm() As Variant _
    , ByVal vRowNumber As Variant _
    ) As Boolean

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

    rTo(X, RowNumber) = vFm(X)
       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) = "To"
       avarNew(2) = "yards"
    for example
       ? VariantVectorToMatrixRow(avarTable(), avarNew(), 2)
       ? VariantMatrixToString(avarTable(), " ", vbCrLf)
       From feet
       To yards
See also:
    VariantMatrixRowToVector Function (near inverse)
    VariantVectorToMatrixColumn Function
rTo: Two-dimensional array of Variants in which one of the rows 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 row in rTo.
vRowNumber: Number of the Row in rTo whose values will be replaced.
Return value: Function does nothing and returns False if vRowNumber 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