Public Function FileCharacterFrequency( _ ByRef rCounts() As Variant _ , ByVal vFileName As Variant _ ) As Long
Assuming StringToFile(Chr$(1) + Chr$(2) + Chr$(1), "FCF.TMP") = True for example FileCharacterFrequency(avarCounts(), "FCF.TMP") = 3 Dim avarCounts() As Variant leaves LBound(avarCounts) = 0 UBound(avarCounts) = 255 avarCounts(0) = 0& avarCounts(1) = 2& avarCounts(2) = 1& avarCounts(3) = 0& ' ... avarCounts(255) = 0&See also:
CharacterCountsToVariantVector Function SortCharactersByFrequency FunctionrCounts: Dynamic array of Variant values that will receive the character counts. This function will automatically re-dimension the array from 0 to 255. The value of element N is the count of characters with that ASCII value.
v1.2 BugFix: Corrected a problem so that elements will now be set to 0& (zero Long) instead of left as Empty when the corresponding character does not appear in the file.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.