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

Variant Matrix To String Function
Array Conversions Class

Public Function VariantMatrixToString( _
      ByRef vLines() As Variant _
    , ByVal vColumnSeparator As Variant _
    , ByVal vRowSeparator As Variant _
    ) As String

Assembles the elements of a two-dimensional Variant array into a String.
Combine elements 1..UBound, 1..UBound of vLines into a String separated by vColumnSeparator.
Separators are not included when there is only one element in the dimension.

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"
    for example
       ? VariantMatrixToString(avarTable(), " ", vbCrLf)
       From feet
       To meters
       ? VariantMatrixToString(avarTable(), "=", "&")
       From=feet&To=meters
See also:
    StringToVariantMatrix Function (near inverse)
    VariantVectorToString Function
vLines: Two-dimensional array of Variants that will be assembled into a String. 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.
Note: This function starts with element #1 in each dimension, instead of starting at the lower bound of the dimension.
vColumnSeparator: String that will separate columns within the result string. vColumnSeparator defaults to an empty String if it is missing or cannot be fixed-up to a String.
vRowSeparator: String that will separate rows within the result string. vRowSeparator defaults to an empty String if it is missing or cannot be fixed-up to a String.

Return to ENTISOFT Home Page

Copyright © 1999-2005 Entisoft