Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

just pass one of the chosen letters 1

Status
Not open for further replies.

kruxty

Programmer
Jul 17, 2001
197
PT
i have this code:
valor = InStr(inline, "P") Or InStr(inline, "S")
If valor = 1 Then
Open Text2.Text & "\" & nomefichtxt For Append As #2
Print #2, inline
Close #2
End If

but he only passes me the strings that begin with S, Why?
 
Instr function returns the position within the target string were the substring exists.
You should modify it as

valor=0
valor = InStr(inline, "P") Or InStr(inline, "S")
If valor <> 0 Then
Open Text2.Text & &quot;\&quot; & nomefichtxt For Append As #2
Print #2, inline
Close #2
End If


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top