Option Explicit
Dim b As Byte
Private Sub test()
Dim z As Long
Use 5
Use 6
Use 6
For z = 0 To 7
Debug.Print z, Used(z)
Next z
End Sub
Public Sub Use(ByVal n As Long)
b = b Or 2 ^ n
End Sub
Public Function Used(ByVal n As Long) As Boolean
Used = b And 2 ^ n
End Function
The function Used() tells us which numbers have been used.
How would you keep track of the number of times they have been used (in the
sample 5->1, 6->2)?

Signature
Lyle
--
Bob Quintal - 19 Feb 2005 13:56 GMT
> Option Explicit
> Dim b As Byte
[quoted text clipped - 20 lines]
> How would you keep track of the number of times they have been
> used (in the sample 5->1, 6->2)?
declare a public array of int in test, increment the applicable
subscript in used.

Signature
Bob Quintal
PA is y I've altered my email address.