Results 1 to 5 of 5

Thread: [RESOLVED] Instr Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    377

    Resolved [RESOLVED] Instr Question

    I'm trying look in the HTML to see if "_oldsettt_r" is present... I'm not sure why but it's not working. is my Instr code wrong?

    VB Code:
    1. HTML2 = Inet.OpenURL(sURL & sID)
    2.  
    3. Do
    4.     DoEvents
    5. Loop Until Inet.StillExecuting = False
    6.  
    7. Debug.Print HTML2 ' html code is there and "_oldsettt_r" is present
    8.  
    9. If InStr(HTML2, "_oldsettt_r") = True Then
    10. ....

  2. #2

  3. #3
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: Instr Question

    InStr returns -1 (= True) only on error condition, such as search keyword being a null string.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Instr Question

    InStr doesn't return -1:
    Return Values

    If InStr returns
    string1 is zero-length 0
    string1 is Null Null
    string2 is zero-length start
    string2 is Null Null
    string2 is not found 0
    string2 is found within string1 Position at which match is found
    start > string2 0

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2001
    Posts
    377

    Re: Instr Question

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width