B
brock
Hi, I do apologize as I'm sure this kind of post is frowned on... But
I'm stumped and just need a kick in the right direction...
I'm using Visual Basic 2008 Express Edition.
My goal: Take input from a TextBox, check it for a certain string, and
output the remainder of the line to a file.
I've just about everything working, except the part that gets the
remainder of the line. That is the part that has got me stumped.
This is what I have (and I welcome and criticism/advice)
Dim sOutput As String
Dim iPos As Integer
Dim sData As String
Dim sChar As String
Dim iLooking As Integer
Dim sInput As String
sInput = RegistrationInput.Text
iPos = InStr(sInput, "1a_firstname: ")
If iPos = 0 Then
sOutput = "1a_firstname: Not found!"
Else
iLooking = iPos + 14
sChar = GetChar(sInput, iLooking)
While sChar IsNot vbCrLf
iLooking += 1
sData += sChar
sChar = GetChar(sInput, iLooking)
End While
sOutput = sData
End If
My.Computer.FileSystem.WriteAllText("C:\My Computer
\conference_reg.txt", sOutput, False)
I'm stumped and just need a kick in the right direction...
I'm using Visual Basic 2008 Express Edition.
My goal: Take input from a TextBox, check it for a certain string, and
output the remainder of the line to a file.
I've just about everything working, except the part that gets the
remainder of the line. That is the part that has got me stumped.
This is what I have (and I welcome and criticism/advice)
Dim sOutput As String
Dim iPos As Integer
Dim sData As String
Dim sChar As String
Dim iLooking As Integer
Dim sInput As String
sInput = RegistrationInput.Text
iPos = InStr(sInput, "1a_firstname: ")
If iPos = 0 Then
sOutput = "1a_firstname: Not found!"
Else
iLooking = iPos + 14
sChar = GetChar(sInput, iLooking)
While sChar IsNot vbCrLf
iLooking += 1
sData += sChar
sChar = GetChar(sInput, iLooking)
End While
sOutput = sData
End If
My.Computer.FileSystem.WriteAllText("C:\My Computer
\conference_reg.txt", sOutput, False)