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

Character Counts To Variant Vector Function
Character Arrays Class

Public Function CharacterCountsToVariantVector( _
      ByRef rCounts() As Variant _
    , ByVal vString As Variant _
    ) As Boolean

Fill the elements of an Integer array so that they each represent the number of occurrences of the character with that ASCII value in string vString.

Example:
    Assuming
       Dim avarCounts() As Variant
    for example
       CharacterCountsToVariantVector avarCounts(), "ABBCCC"
    leaves
       LBound(avarCounts) = 0
       UBound(avarCounts) = 255
       avarCounts(X) = 0
    except for
       avarCounts(Asc("A")) = avarCounts(65) = 1
       avarCounts(Asc("B")) = avarCounts(66) = 2
       avarCounts(Asc("C")) = avarCounts(67) = 3
See also:
    FileCharacterFrequency Function
    SortCharactersByFrequency Function
rCounts: The dynamic array of Variants in which the character counts will be stored.
vString: The strings whose character counts are to be determined. Function returns False and leaves rCounts uninitialized if vString is Null or cannot be fixed up to a String.

Function returns True upon success.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.