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

Variant Vector To String Function
Array Conversions Class

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

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

Example:
    Assuming
       Static avarCodes(0 To 3) As Variant
       avarCodes(1) = "A45"
       avarCodes(2) = "B12"
       avarCodes(3) = "C6"
    for example
       ? VariantVectorToString(avarCodes(), "--")
       A45--B12--C6
       ? VariantVectorToString(avarCodes(), "")
       A45B12C6
v1.5 BugFix: Corrected a bug in the Example above.
See also:
    Join Function (Visual Basic)
    StringToVariantVector Function (near inverse)
    VariantMatrixToString Function
vLines: One-dimensional array of Variants that will be assembled into a String.
Note: This function starts with element #1 instead of starting at the lower bound.
vColumnSeparator: String that will separate each of the elements within the result string. vColumnSeparator defaults to an empty String if it is missing or cannot be fixed-up to a String.
v1.5 Note: This function is very similar to the new Join function in Visual Basic 6.0.

Return to ENTISOFT Home Page

Copyright 1999-2005 Entisoft