Results 1 to 15 of 15

Thread: compare variables

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86

    Resolved compare variables

    can someone help me
    i want to create some sort of login
    this is what i have

    VB Code:
    1. Function logingo()
    2. Dim urlbestand As String
    3. Dim gegevens As String
    4. Dim splitten As String
    5. Dim splitten2 As String
    6. Dim splitten3 As String
    7. Dim splitten4 As String
    8. Dim splitten5 As String
    9. Dim bstand As Boolean
    10. Dim pathnaam As String
    11. Dim loginjuist As Boolean
    12. urlbestand = Environ("commonProgramFiles") & "\dcq369\log.dat"
    13. pathnaam = Environ("commonProgramFiles") & "\dcq369\schrfbvgdhd.dat"
    14. If Len(Dir$(urlbestand)) > 1 Then
    15. bestand = True
    16. Else
    17. MsgBox "er zijn geen personen geregistreerd", vbExclamation, "opmerking"
    18. End If
    19. If bestand = True Then
    20. Open urlbestand For Input As #1
    21. gegevens = Input(LOF(1), #1)
    22. Close #1
    23. splitten = Split(gegevens, "||")(1)
    24. splitten2 = Split(splitten, "=")(1)
    25. For i = 1 To splitten2
    26. splitten3 = Split(gegevens, "||")(i + 1)
    27. splitten4 = Split(splitten3, "&&")(0)
    28. splitten5 = Split(splitten3, "&&")(1)
    29.  [COLOR=red]
    30. MsgBox splitten4
    31. MsgBox splitten5
    32. MsgBox Text1.Text
    33. MsgBox Text2.Text
    34. [/COLOR]
    35. If splitten4 Like Text1.Text And splitten5 Like Text2.Text Then
    36. loginjuist = True
    37. Exit For
    38. Else
    39. loginjuist = False
    40. End If
    41. Next i
    42. End If
    43. If loginjuist = True Then
    44. Open pathnaam For Output As #1
    45. Print #1, "ja"
    46. Close #1
    47. progamma.Show
    48. Unload login
    49. Else
    50. MsgBox "uw gegevens zijn fout probeer opnieuw of druk op doorgaan", vbExclamation, "opmerking"
    51. End If
    52. End Function

    the message boxen in red are being compared but they are equal and the script don't seethem as equal variables what do i have to do to get them equal
    Last edited by davyquyo; Oct 19th, 2004 at 08:28 PM.

  2. #2

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    i used trim to delete spaces but stil it won't work

    wat else can i do

    i figured out that this is wrong

    And splitten5 Like Text2.Text

    because when i remove this it works good

    any suggestions

    i als say that Text2.Text has pasword character
    maybe this is wrong can it be ????
    Last edited by davyquyo; Oct 19th, 2004 at 12:02 PM.

  4. #4
    Lively Member
    Join Date
    Sep 2004
    Posts
    96
    Add parens to control the order of operation:
    VB Code:
    1. If ((splitten4 Like Text1.Text) And (splitten5 Like Text2.Text) Then

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    when is just say this

    if splitten5 Like Text2.Text Then

    then i got the same problem

  6. #6

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    wel the is for the user to decide i test it with my family name

    in the message i receive this

    splitten5=quyo
    Text2.Text=quyo

  8. #8

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    nope won't do

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    i placed this in the web maybe someone can take a look at it
    i hope you can help me

    http://www.davyquyo.be/login.zip

  11. #11

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    wel download the program
    register en then login
    you wil see that variables are the same
    but the login is not accepted

    i replaced youre parts but the same effect take's place

    there where no error's

  13. #13
    Member
    Join Date
    Mar 2002
    Location
    Dallas
    Posts
    50
    Wow.. this seems like an exceedingly difficult login routine.

    Why, exactly - are you trying to compare the two strings?
    Or are you just comparing the two because it's not working correctly?

    It's hard to figure out whats going on when it's written in German(?). Even though the language (VB) hasn't changed at all.


    However.. after adding a breakpoint to the Login button and stepping through the code.. I found that somewhere there are two extra characters appended to the end of your "password" string..

    I attached a picture of what i'm talking about..
    Attached Images Attached Images  
    What do you mean it doesn't work? I had it working just a minute ago!

  14. #14
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Originally posted by Kedaeus
    Wow.. this seems like an exceedingly difficult login routine.

    Why, exactly - are you trying to compare the two strings?
    Or are you just comparing the two because it's not working correctly?

    It's hard to figure out whats going on when it's written in German(?). Even though the language (VB) hasn't changed at all.


    However.. after adding a breakpoint to the Login button and stepping through the code.. I found that somewhere there are two extra characters appended to the end of your "password" string..

    I attached a picture of what i'm talking about..
    That's what I was trying to show by adding an "X" at the start and end of the variables. It would have shown (at least) that one was longer than the other.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Posts
    86
    it's written in dutch and i'm not good ad vb
    i'm a flashdesigner

    but this is what i use to get date out of a textfield for some sord of login

    i willl try to solve the problem
    and i added the messageboxen so i could see what was goining and if my vars where correct


    now dat i know what the problem is i have solved the problem
    thanx for the help
    Last edited by davyquyo; Oct 19th, 2004 at 08:28 PM.

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