borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Web Browser for blinds)Next Topic (Hiding process) New Topic New Poll Post Reply
AndreaVB Forum : API : search a word in a text
Poster Message
frenchy371
Level: Guest


Ads by Lake Quincy Media
icon search a word in a text

Hello
I have to select a word in a text and i think that a dll can do that for me
like Find(text,word)
and returning the text with the selected word

do you know a dll for this pb?

Thanks

07-02-2003 at 03:15 PM
| Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: search a word in a text

i don't know of any existing dll that does this, but i could give you an idea so that you can create your own dll, or perhaps place it in a module or class...


the idea would be to take the word to be searched, and get its first letter, then search the text. when the 1st letter is encountered, then go back to the word and get the next letter. if it doesn't match, then go back to the first letter, then continue searching... do this until the word is completed...

the problem would be if there were to exist many words of that kind.

could you explain instead what you need this code for?

there could be another way to do this task.

____________________________
Been busy trying to take a second degree <--it's not working out...

18-02-2003 at 05:42 PM
View Profile Send Email to User Show All Posts | Quote Reply
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876
icon Re: search a word in a text

i got this from somewhere in the net... hope it helps you.

don't know a dll that does this... but of course you could manipulate this and insert it in a module, class... create your dll!

Dim ErrCnt As Long
Dim Swords(5) As String
Dim ErrFnd As Boolean

Private Sub Form_Load()
'Words in array to search for
    Swords(0) = "these"
    Swords(1) = "are"
    Swords(2) = "words"
    Swords(3) = "to"
    Swords(4) = "be"
    Swords(5) = "searched"
End Sub  

Private Sub Command1_Click()
'set trigger to false
ErrFnd = False
' loop from swords(0) to swords(5)
      For x = 0 To 5
'if one of the swords is found
          If Instr(1, Text1, Swords(x)) > 0 Then
' activate flag
             ErrFnd = True
' Show result
             MsgBox "Found Word " & Swords(x)
'count how many words
             ErrCnt = ErrCnt + 1
' end if statement
          End If ' end loop
      Next
'if the flag was activated
If ErrFnd = True Then
'show how many words were found
MsgBox ErrCnt & "  Words found"
' set the word count back to 0
ErrCnt = 0
' end if statement
End If
End Sub


see yah!  

____________________________
Been busy trying to take a second degree <--it's not working out...

19-02-2003 at 07:22 PM
View Profile Send Email to User Show All Posts | Quote Reply
aralexryan9@gmail.com
Level: Trainee

Registered: 23-08-2010
Posts: 1
icon Re: search a word in a text

I don't know a dll that does this,but you can use some c# word component to search a word ,like Spire.Doc,I use it long time, quit good. May help to you.

[Edited by admin on 26-08-2010 at 01:13 PM GMT]

____________________________
ALEX Ryan

24-08-2010 at 04:23 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : search a word in a text
Previous Topic (Web Browser for blinds)Next Topic (Hiding process) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder