I decided to teach myself vb.net. I decided to make a stupid program just to get used to the language. I'm taking a string of character codes that I want to turn back into their respectable aplha/numeric state. Now, I can go from string to code easy, but going back again I'm running into errors. I'm sure it's my logic. Anyway here is my code please help if you can.
Also any weblinks with tutorials on string manipulation and arrays would be nice. Or any other links would be cool. My next project involves useing a timer. I'll probly post again.
Thanks for the help.
Code:
' Declare Variables Used In Function
Dim textoutput As String = txt_output.Text
Dim jletter As String
Dim j As Integer = 0
Dim jlength As Integer = Len(textoutput)
' Clear Input Box
If txt_input.Text <> "" Then
txt_input.Text = ""
End If
' Loop Decode Code to Text
For j = 0 To jlength
If ((textoutput.Substring(j) <> " ") And (textoutput.Substring(j) <> ",")) Then
If j = jlength Then
jletter = textoutput.Substring(j)
txt_input.Text = txt_input.Text & Chr(Val(jletter))
ElseIf textoutput.Substring(j + 1) = "" Then
jletter = textoutput.Substring(j)
txt_input.Text = txt_input.Text & Chr(Val(jletter))
ElseIf textoutput.Substring(j + 1) = "," Then
jletter = textoutput.Substring(j)
txt_input.Text = txt_input.Text & Chr(Val(jletter))
ElseIf textoutput.Substring(j + 2) = "," Then
jletter = textoutput.Substring(j)
j = 1 + j
jletter = jletter & textoutput.Substring(j)
txt_input.Text = txt_input.Text & Chr(Val(jletter))
ElseIf textoutput.Substring(j + 3) = "," Then
jletter = jletter & textoutput.Substring(j)
j = 1 + j
jletter = jletter & textoutput.Substring(j)
j = 1 + j
jletter = jletter & textoutput.Substring(j)
txt_input.Text = txt_input.Text & Chr(Val(jletter))
End If
End If
Next j
Also any weblinks with tutorials on string manipulation and arrays would be nice. Or any other links would be cool. My next project involves useing a timer. I'll probly post again.
Thanks for the help.