Wrox Programmer Forums
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 24th, 2004, 04:30 PM
Authorized User
Join Date: Jun 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default Search Function

I have a text file with value of

"99 Anywhere st. Nowhere Ave." And
"99 Anywhere Sreet. Nowhere Avenue"

I want to extract both data.
what Vb function should I use to extract both

I've tried Instr but it doesn't work.

Old March 24th, 2004, 11:37 PM
Registered User
Join Date: Mar 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Dim FileNumber As Integer
Dim MyString As String
FileNumber = FreeFile

Open "c:\test.txt" For Input As #FileNumber

Do Until EOF(FileNumber)
   i = 1
   Line Input #FileNumber, MyString
   'One line of data now contained in
   'MyString variable. Process as necessary.
    Debug.Print MyString
    For z = 1 To Len(MyString)

Now Use InStr and Mid function to extract your string.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a search function Brendan Bartley ASP.NET 1.0 and 1.1 Basics 1 September 30th, 2008 03:40 PM
Search function talktome Excel VBA 1 September 6th, 2005 12:47 AM
search function elania MySQL 1 February 6th, 2005 07:00 PM
Search function Urban_Roughneck Beginning PHP 9 January 21st, 2005 08:31 AM
Search Function damnnono_86 Access 30 October 14th, 2003 09:02 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.