Class key
dim s = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
dim s_len
dim k[] = 0,0,0,0,0,0,0,0,0,0,0
dim k_end
dim keystring = ""
Procedure key
s_len = Length(s)
k_end = Length(k) - 1
Fend
Function next()
inc(0)
keystring = ""
For i = k_end to 0 step -1
Ifb k[i] Then
For i = i to 0 step -1
keystring = keystring + copy( s, k[i], 1 )
Next
Result = keystring
Exit
Endif
Next
Fend
Procedure inc( c )
k[c] = k[c] + 1
Ifb s_len < k[c] Then
k[c] = 1
inc(c+1)
Endif
Fend
EndClass |
|