Results 1 to 11 of 11

Thread: Like Operator [Resolved]

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    5

    Like Operator [Resolved]

    Hi all!!
    I did a seach for the like operator and could find this question asked before so here goes.....

    I have a Function that takes a string (of an IP address) and uses the like operation to see if the format of the IP is correct,

    Code:
    Public Function IPSim(ByVal IPS As String) As Boolean
        Dim Isit As Boolean
        Isit = IPS Like "#.#.#.#" Or "#.#.#.##" Or "#.#.#.###" Or "#.#.##.#" Or "#.#.##.##" Or "#.#.##.###" Or _
        "#.#.###.#" Or "#.#.###.##" Or "#.#.###.###" Or "#.##.#.#" Or "#.##.#.##" Or "#.##.#.###" Or "#.##.##.#" Or _
        "#.##.##.##" Or "#.##.##.###" Or "#.##.###.#" Or "#.##.###.##" Or "#.##.###.###" Or "#.###.#.#" Or _
        "#.###.#.##" Or "#.###.#.###" Or "#.###.##.#" Or "#.###.##.##" Or "#.###.##.###" Or "#.###.###.#" Or _
        "#.###.###.##" Or "#.###.###.###" Or "##.#.#.#" Or "##.#.#.##" Or "##.#.#.###" Or "##.#.##.#" Or _
        "##.#.##.##" Or "##.#.##.###" Or "##.#.###.#" Or "##.#.###.##" Or "##.#.###.###" Or "##.##.#.#" Or _
        "##.##.#.##" Or "##.##.#.###" Or "##.##.##.#" Or "##.##.##.##" Or "##.##.##.###" Or "##.##.###.#" Or _
        "##.##.###.##" Or "##.##.###.###" Or "##.###.#.#" Or "##.###.#.##" Or "##.###.#.###" Or "##.###.##.#" Or _
        "##.###.##.##" Or "##.###.##.###" Or "##.###.###.#" Or "##.###.###.##" Or "##.###.###.###" Or "###.#.#.#" Or _
        "###.#.#.##" Or "###.#.#.###" Or "##.#.##.#" Or "##.#.##.##" Or "###.#.##.###" Or "###.#.###.#" Or _
        "###.#.###.##" Or "###.#.###.###" Or "###.##.#.#" Or "###.##.#.##" Or "###.##.#.###" Or "###.##.##.#" Or _
        "###.##.##.##" Or "###.##.##.###" Or "###.##.###.#" Or "###.##.###.##" Or "###.##.###.###" Or _
        "###.###.#.#" Or "###.###.#.##" Or "###.###.#.###" Or "###.###.##.#" Or "###.###.##.##" Or "###.###.##.###" Or _
        "###.###.###.#" Or "###.###.###.##" Or "###.###.###.###"
        If Isit = True Then...........
    Anyways, when I run this I get a type mismatch error 13. Now I have done something like this before and it did work, is there some glaring error that I'm overlooking?

    Thanks in advance!!
    Last edited by BooDa72; Apr 18th, 2005 at 05:08 PM.
    There’s nothing like ‘free elections’ coupled with ‘martial law’. It just screams democracy........ Matt Good

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