ARC
Well-known member
Could anyone offer a hint at what I'm doing wrong? This only spits out the first letter ascii value then stops.
I tried doing it like "do until counter > 4" and also "do while counter < 4" and neither of those worked either. Same result. I figured i would try the above ("do loop until loop"). Nothing.
I want it to run until all the text in the text box is converted to anscii but I wanted to make sure I was using the loop properly first so im trying this.
Any hints or suggestions would be greatly appreciated!
VB.NET:
[SIZE=2]counter = 1[/SIZE][SIZE=2]
encodeme = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].TextBox1.Text
codedTextBox2 = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].TextBox2.Text
[/SIZE][SIZE=2][COLOR=#0000ff]Do
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#008000]'grabs (Counter) letter from the string in TextBox1
[/COLOR][/SIZE][SIZE=2]letter = Microsoft.VisualBasic.Mid(encodeme, counter, 1)
[/SIZE][SIZE=2][COLOR=#008000]'changes "letter" into uppercase
[/COLOR][/SIZE][SIZE=2]coded = UCase(letter)
[/SIZE][SIZE=2][COLOR=#008000]'changes coded into ascii value
[/COLOR][/SIZE][SIZE=2]newcoded = Asc(coded)
[/SIZE][SIZE=2][COLOR=#008000]'adds the ascii'd letter to the end of whatever is in TextBox2
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].TextBox2.Text = codedTextBox2 + newcoded
counter = counter + 1
[/SIZE][SIZE=2][COLOR=#0000ff]Loop[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Until[/COLOR][/SIZE][SIZE=2] counter > 4
[/SIZE]
I tried doing it like "do until counter > 4" and also "do while counter < 4" and neither of those worked either. Same result. I figured i would try the above ("do loop until loop"). Nothing.
I want it to run until all the text in the text box is converted to anscii but I wanted to make sure I was using the loop properly first so im trying this.
Any hints or suggestions would be greatly appreciated!