PESQUISADOR BIBLICO

JPLSH 29/06/2011 18:20:48
#378062
Amigos eu to fazendo um Pesquisador Bíblico mas não to conseguindo usar a função InStr para fazer pesquisas exatas:
Ex: escrevo a palavra deus ele retorna Deus, judeus, deuses etc.
Estou mandando o código-fonte por favor me ajudem, agradeço a todos!!!
MARCELO.TREZE 29/06/2011 18:40:35
#378063
Resposta escolhida
pra vc achar apenas deus, vc terá de procurar assim

Instr(1,texto, [Ô] Deus [Ô])

com espaço no começo e fim
MARCELO.TREZE 30/06/2011 14:41:15
#378154
testa ai colega

Private Sub cmdBuscar_Click()
Dim lin As String, pal As String, qtde As Integer
Dim Livro As String, Linha As String, temp As String

If txtBuscar.Text <> [Ô][Ô] Then
tmrTempo.Enabled = True
qtde = 0: Linha = [Ô][Ô]: Label2.Caption = 0: Label4.Caption = [Ô]Versículos encontrados:[Ô]
rtfTexto.Text = [Ô]Pesquisando...[Ô]: pal = UCase(txtBuscar.Text)
Open App.Path & [Ô]
ovo.txt[Ô] For Input As #1
Do While Not EOF(1)
DoEvents
Line Input #1, Linha [ô] Le linha por linha
If Left(Linha, 1) = [Ô]>[Ô] Then Livro = Linha
lin = UCase(Linha)
[ô] Aqui estou usando InStr mas nao consigo fazer uma pesquisa exata
If InStr(lin, [Ô] [Ô] & pal & [Ô].[Ô]) <> 0 Or InStr(lin, [Ô] [Ô] & pal & [Ô]:[Ô]) <> 0 Or _
InStr(lin, [Ô] [Ô] & pal & [Ô],[Ô]) <> 0 Or InStr(lin, [Ô] [Ô] & pal & [Ô];[Ô]) <> 0 Or _
InStr(lin, [Ô] [Ô] & pal & [Ô]![Ô]) <> 0 Or InStr(lin, [Ô] [Ô] & pal & [Ô]?[Ô]) <> 0 Or _
InStr(lin, [Ô] [Ô] & pal & [Ô]([Ô]) <> 0 Or InStr(lin, [Ô] [Ô] & pal & [Ô])[Ô]) <> 0 Or _
InStr(lin, [Ô] [Ô] & pal & [Ô][[Ô]) <> 0 Or InStr(lin, [Ô] [Ô] & pal & [Ô]][Ô]) <> 0 Or InStr(lin, [Ô] [Ô] & pal & [Ô] [Ô]) <> 0 Then
If temp = [Ô][Ô] Then [ô] Repete o livro
temp = Livro & vbCrLf & Linha
Else
temp = temp & vbCrLf & vbCrLf & Livro & vbCrLf & Linha
End If
qtde = qtde + 1
End If
Loop
Close #1
tmrTempo.Enabled = False: rtfTexto.Text = temp
If Trim(txtBuscar.Text) <> [Ô][Ô] Then
Dim Criterio As Integer
Criterio = destacandoPalavras(rtfTexto, txtBuscar.Text, vbRed)
End If
Label4.Caption = [Ô]Versículos encontrados: [Ô] & qtde
End If
End Sub
Tópico encerrado , respostas não são mais permitidas