Results 1 to 4 of 4

Thread: Compare Arrays and Display Diferent Elements

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    127

    Compare Arrays and Display Diferent Elements

    Dear All,

    I'm trying to create a Function, that I pass 2 arrays or 2 string,

    and then i need to compare those 2 arrays and display just the elements that do not match.

    Example:
    -----------------------------------
    Dim Remote(3) As String
    Dim strLocal(2) As String


    Remote(0) = "Jack"
    Remote(1) = "John"
    Remote(2) = "Peter"
    Remote(3) = "Peter Pan"


    strLocal(0) = "Jack"
    strLocal(1) = "John"
    strLocal(2) = "Peter"

    -----------------------------------

    The output in the case above would be "Peter Pan" has it is the new elemente.

    The ideia is I create 2 arrays, on which contains local files and another remote files, by comparing those two arrays i know exactly what to download.

    Your help is appreciated

    kind regards
    ASPWIZARD

    http://www.aspwizard.co.uk

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I'm sure a function like that has been written very recently. Search "delete duplicates" or something like that, and modify the code with the poster's permission to suit your needs.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Sastraxi: I know your "with the poster's permission" comment refers to the problem with the new forum rules. That issue (in my opinion at least) has been resolved. If you still have concerns please send me an email and if you want me to I will make sure that the new owners are aware of them.

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Actually, Martin, in that case it didn't... I just mean that if you are going to go, use his code, and modify it... well, it sounded good at the time
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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