dcsimg
Results 1 to 6 of 6

Thread: [VB6] Compare, and generate new

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    5

    [VB6] Compare, and generate new

    Hi

    I would like to know how I should do the following :

    I input 3 or more strings (eg "kf - 12", "kd - 13", "fd - 23"), and then I would like to generate another (eg "kk - 11").

    I am using VB6

    Thanks

    Greets
    Kosty

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: [VB6] Compare, and generate new

    You'll have to tell us the algorithm or formula that the generated one is created by.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    5

    Re: [VB6] Compare, and generate new

    It is build on 2 parts

    AAA - 333 | BBB - 444

    For example, the above string is one 'input' string

    I think, the First 2 (AAA - 333) must be compared with the second 2 (BBB - 444) and if those two match, AFTER a mathematic check
    Eg, all in decimal, and if the first 2/3 = second 2/4

    It is very hard to explain, but it is the formula I want the program to search

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: [VB6] Compare, and generate new

    If it's a formula, just post the formula. Explaining math in English sometimes just doesn't work

    All you've said so far is that if the first 2 meet some formula when compared to the second 2, the fifth one is generated. That's no more information than you originally posted. We need to know exactly what "match" means in this case, what to do if there is a match and what to do if there is no match.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  5. #5

    Thread Starter
    New Member
    Join Date
    Oct 2007
    Posts
    5

    Re: [VB6] Compare, and generate new

    You dont realy get it, I think

    Think of it as a name and number

    The first part is a name (AAA - 333 -> Joe), the Second part is a serial number (BBB - 444 -> 123). They match.

    Now I want to know what the match is between AAA - 333 and Joe, BBB - 444 and 123
    AAA - 333 - BBB - 444 is 1 WORKING code, like your windows' CD key

    ==

    But as you said it is going to be really hard to find the matching formula, and thats my question, how to build a program that can do this
    Last edited by Kosty; Oct 31st, 2007 at 05:31 PM.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    18,597

    Re: [VB6] Compare, and generate new

    I don't get it either, how does AAA - 333 match BBB - 444? If you were to test, CStr("AAA - 333")=CStr("BBB - 444"), the result would be False.

    The only way I can see they match would be a pattern:
    1. For each number: 444 compared to 333, there is a difference of 111 (numbers)
    2. For each letter: BBB compared to AAA, there is a difference of 111 (letters)
    So, as a pattern I can see that they could match. But that is an algorithm based on a pattern using one example. Is that the algorithm used? If not, you should supply the algorithm for comparison, otherwise, all of us will simply be guessing.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width