|
-
Nov 2nd, 1999, 01:35 AM
#1
Thread Starter
New Member
How do I find and extract strings from large strings/files (+100kB) f-a-s-t ? I've tried the RichTextBox.Find() and InStr() methods. They work fine when you search in smaller text, but when the string is big... 
Example...
Sub TooSlow()
Dim i As Long
Dim j As Long
i = RichTextBox1.Find("<a href", , , rtfNoHighlight)
While i > -1
j = RichTextBox1.Find("</a>", i + 7, , rtfNoHighlight)
If j > -1 Then
' do stuff (a = mid(RichTextBox1,i,j) for example
Else
Exit Sub
End If
i = RichTextBox1.Find("<a href", j + 4, , rtfNoHighlight)
Wend
End Sub
Repeating the sub routine ten times is three times faster than calling it once with a ten times larger string...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|