Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 24th, 2004, 02:03 PM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
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 string either Upper case or lower case

Is there a function can I use for this type of problem

First, I have to search for a particular string.

   sComp = "Company list, The"

I want to search for a string ", The"

I used
   nPos = InStr(sComp , ", The")

My question is, sometimes the sComp = "Company list, THE"
and sComp = "Company list, ThE"


Thanks,
Elmer
Reply With Quote
  #2 (permalink)  
Old March 24th, 2004, 02:25 PM
Authorized User
 
Join Date: Jun 2003
Location: , Quebec, Canada.
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Make a compare using vbTextCompare. It will search the string ignoring the case.

nPos = InStr(sComp , ", the", vbTextCompare)

Stéphane Lajoie
Reply With Quote
  #3 (permalink)  
Old March 24th, 2004, 04:15 PM
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
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

Thanks it works Stéphane Lajoie

what if my sComp = "33 Anywhere st. Nowhere Ave."
               and "33 Anywhere Street. Nowhere Avenue"

what should be my search string to get both the sComp

nPos2 = InStr(1, sLine, "?", vbTextCompare)

Thanks,
Elmer
Reply With Quote
  #4 (permalink)  
Old March 24th, 2004, 04:23 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi..

then you will have to use something like this..

if scomp like "33 Anywhere st*. Nowhere Ave" then

b/c you are not interested in the case, add lcase() to both strings...

HTH

Gonzalo
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lower case kgoldvas XSLT 3 February 28th, 2007 07:43 AM
how to make lower case in dataformatstring hardik Classic ASP Databases 1 February 14th, 2006 05:45 AM
first character as Upper Case crmpicco VB How-To 4 July 1st, 2005 01:35 PM
check for lower case (LCase)? crmpicco Excel VBA 2 May 12th, 2005 03:42 PM
Checking for upper,lower case, number and symbol dumbdumb SQL Server 2000 1 March 18th, 2004 03:51 AM



All times are GMT -4. The time now is 05:04 AM.


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