Hey VB Gang!
I attempted to send this previously but failed. behold the introduction of a newbie :-)
Anyway, I am hoping t find a shortcut to fixing a problem. Modifying a text reader software which is supposed to pick only the words I tell it, "Bicycle" as one example:
My form
Dim GoSplit As Variant
Dim strGetWords As String
FileName = "\usermate. txt"
f = FreeFile
Open App.Path + FileName For Input As 1
Do While Not EOF(f)
Line Input #1, strLine
GoSplit = Split(strGetWor ds, " ")
If InStrB(strGetWo rds$, "bicycle") <> 0 Then
'Left() would have picked up "Bicycle"
'InStrB is grabing everything in sight, provided the're somewhat alike like motorcycle
Text2(0).Text = "Bicycle"
End If
I should have used Left() here. Nonetheless I do not have the time to modify the code, my client leaves in aweek to test it.
My Module
Dim MyStr As Variant
Dim GrabMore As String
Public Sub SendOnly()
GrabMore = LyricalContentf ind.Text2(0).Te xt
MyStr = Left(GrabMore, 7)
'hoping to grab only bicyle's 7 characters
'for the time being I am also gettin "cycle" NOT IN THE CODE...
'I get cycle when motocycle is found in the text.
If Left(GrabMore, 7) <> "" Then 'first value performed
LyricalContentf ind.Text2(0).Te xt = "Bicycle"
Else
MsgBox("No words here fun boy!")
'only if there are no words were found, should above come up
LyricalContentf ind.Text2(0).Te xt = ""
End If
End Sub
If you can point me to a solution, it would be great. I am also a VB fan, and would rather make the code do what I want. Any sort of hints you have is appreciated. Have a great week All!
Dököll
I attempted to send this previously but failed. behold the introduction of a newbie :-)
Anyway, I am hoping t find a shortcut to fixing a problem. Modifying a text reader software which is supposed to pick only the words I tell it, "Bicycle" as one example:
My form
Dim GoSplit As Variant
Dim strGetWords As String
FileName = "\usermate. txt"
f = FreeFile
Open App.Path + FileName For Input As 1
Do While Not EOF(f)
Line Input #1, strLine
GoSplit = Split(strGetWor ds, " ")
If InStrB(strGetWo rds$, "bicycle") <> 0 Then
'Left() would have picked up "Bicycle"
'InStrB is grabing everything in sight, provided the're somewhat alike like motorcycle
Text2(0).Text = "Bicycle"
End If
I should have used Left() here. Nonetheless I do not have the time to modify the code, my client leaves in aweek to test it.
My Module
Dim MyStr As Variant
Dim GrabMore As String
Public Sub SendOnly()
GrabMore = LyricalContentf ind.Text2(0).Te xt
MyStr = Left(GrabMore, 7)
'hoping to grab only bicyle's 7 characters
'for the time being I am also gettin "cycle" NOT IN THE CODE...
'I get cycle when motocycle is found in the text.
If Left(GrabMore, 7) <> "" Then 'first value performed
LyricalContentf ind.Text2(0).Te xt = "Bicycle"
Else
MsgBox("No words here fun boy!")
'only if there are no words were found, should above come up
LyricalContentf ind.Text2(0).Te xt = ""
End If
End Sub
If you can point me to a solution, it would be great. I am also a VB fan, and would rather make the code do what I want. Any sort of hints you have is appreciated. Have a great week All!
Dököll
Comment