hhs wrote:
> I guess there is no function(library) about permutation algorithm in
visual
> basic
Not as far as I know.
> Please let me know the permutation algorithm
The algorihm? I can give som code - its not that complicated!
It requires at ListBox names List1 on the form to output the
permutations:
Sub Permute(ByVal Symbols As String, _
Optional ByVal Permutation As String = "")
Dim Position As Long
If Len(Symbols) > 0 Then
For Position = 1 To Len(Symbols)
Permute Left(Symbols, Position - 1) & _
Mid(Symbols, Position + 1), _
Permutation & Mid(Symbols, Position, 1)
Next Position
Else
List1.AddItem Permutation
End If
End Sub
You call it by: Permute "12345"
-------
Tomas
|