Quote:
sigh yet another dead end of searching....I can't even begin to start this one, I am stumped....SO I came here...
what I am looking for is....
a code that will change the letter in a text box +1 (including A - Z 'upper and lower case' ,numbers/charaters ) pretty much anything that is "normally used for typing" I want it to go off in order.
after it gets to the last one in the order it goes back to the first keeps it in the first spot and does the same loop with the seccond spot, then changes the first one to the seccond in the loop, etc....
example:
A
B
.(skip ahead)
.(skip ahead)
Z
AA
AB
.(skip ahead)
.(skip ahead)
BA
BB
if you don't get that then I can explain it better.
I only need the basic code and idea of how to do it, not the entire thing, I know it will be long...maybe lol.
The most usual characters that are used in typing start from 32 to 255. So you need to loop from there.
vb.net Code:
Private codesList As List(Of String) 'To hold our generated values
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'All codes it too time consuming. We take only A to E for example here
GenerateCodes("A", "E")
End Sub
Private Sub GenerateCodes(ByVal startChar As Char, ByVal endChar As Char)
'initialize and empty list where we will store the codes
codesList = New List(Of String)
'Get the codes
GetCodes("", Asc(startChar), Asc(endChar))
'Now we have all the codes we want. So let's display it in our debug window
For Each s As String In codesList
Debug.Print(s)
Next
End Sub
'Recursive function
Private Sub GetCodes(ByVal code As String, ByVal startIndex As Integer, ByVal endIndex As Integer)
For i As Integer = startIndex To endIndex
Dim newCode As String = code & Chr(i)
codesList.Add(newCode)
GetCodes(newCode, startIndex, i - 1)
GetCodes(newCode, i + 1, endIndex)
Next
End Sub