Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Searching string


Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2003, 06:06 PM
NoMercy NoMercy is offline
Centurion
 
Join Date: Jan 2002
Posts: 184
Default Searching string


Hey I looked around a lot here and on msdn and I can't find what I am looking for. I want to be able to search a string for 1 word. But more specifically I want to check the source of a website and see what is in its title. I got the part where I get the source into a string how can I then search it for 3 different words. Hope that makes sense. TY

Oh and it also works if I can not even have to search for 3 specific words in the title but to just take the first word in the title into a string. Make sense... SO if title is Bob the builder eats baseballs
I want a string to give me Bob. ? lol
__________________
Squeak Squeak
Reply With Quote
  #2  
Old 10-08-2003, 06:41 PM
J0n J0n is offline
Junior Contributor
 
Join Date: Jun 2003
Location: Australia
Posts: 241
Default

You can use InStr() to find a string/word inside another string. To get the title of a webpage, you could just search for the <title> and </title> tags, then the text in between them.
To seperate the first word from a string, you can use InStr() to search for a space character, then use Left() to return the characters before the space, something like:
Code:
If InStr(1, Text1.Text, " ") Then Text1.Text = Left(Text1.Text, InStr(1, Text1.Text, " ")) End If
Reply With Quote
  #3  
Old 10-08-2003, 06:59 PM
NoMercy NoMercy is offline
Centurion
 
Join Date: Jan 2002
Posts: 184
Default

K that will work ty. Now for my next question. I have everything done and working. But once I add the timer to ahve it refresh every 3 mins when it loads it gets a run time error 91 saying object of with variable not set. This is on the
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Text1.Text = WebBrowser1.Document.DocumentElement.InnerHTML
__________________
Squeak Squeak
Reply With Quote
  #4  
Old 10-08-2003, 07:03 PM
NoMercy NoMercy is offline
Centurion
 
Join Date: Jan 2002
Posts: 184
Default

nm I changed documentcomplete to navigate2 and it works
__________________
Squeak Squeak
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a file in dat question ? murphys General 5 11-06-2002 08:34 PM
Open an associated Text Document knoxitis General 19 05-01-2002 11:26 PM
Shareware Registry Protection Technigue karachi999 General 2 01-21-2002 02:40 PM
Loop to format file kingesk General 2 09-10-2000 05:01 PM
File format problem kingesk General 1 09-08-2000 04:52 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->