Date: 02-16-2022
Return to Index
created by gbSnippets
Sub CreateDistribution
Local i As Long, temp$, list$
Dim L(255) As Long, S(32 To 127) As String
For i = 1 To Len(SourceCode)
Incr L(Asc(Mid$(SourceCode,i,1)))
Next
For i = 33 To 127
If L(i) Then S(i) = Format$(L(i),"0000") + $Tab + Chr$(i)
Next
For i = 127 To 33 Step -1
If L(i) = 0 Then Array Delete S(i)
Next
Array Sort S(), Descend
For i = 33 To 127
list$ += "Case " + Str$(Asc(Right$(S(i),1))) + "xxx" + $CrLf
Next
Open "distribution.txt" For Output As #1
Print #1, List$
Close #1
End Sub
http://www.garybeene.com/sw/gbsnippets.htm