Results 1 to 2 of 2

Thread: overflow error, but why? how do i solve it?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    3
    This takes the user input into text1 converts it into a numeric code and encrypts the text in another form, but if you try and make it use hello i get an overflow error, hel works ok. Help, please;

    Private Sub CmdOK_Click()
    If Text1.Text = "" Then Exit Sub
    AlphaKey = Text1.Text
    finalkey = ""
    thelastchar = Len(AlphaKey)
    For i = 1 To thelastchar
    theletter = Mid(AlphaKey, i, 1)
    finalkey = finalkey & Asc(theletter)
    Next i
    Open "pass.log" For Output As #1
    thelastchar = Len(FrmPasswords.Text1.Text)
    For i = 1 To thelastchar
    theletter = Mid(FrmPasswords.Text1.Text, i, 1)
    Print #1, Asc(theletter) Xor finalkey; <<<<<<- Here
    Next i
    Close #1
    SaveSetting "passpro", "Encryption", "codeno", finalkey
    SaveSetting "Passpro", "Encryption", "Cryptvalue", "2"
    Open "pass.log" For Input As #1
    FrmPasswords.Text1.Text = Input(LOF(1), 1)
    Close #1
    Unload frmKey
    End Sub

    thanks:-)
    [email protected]
    65487558
    -----------
    VS6 ENT SP4

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    I am not sure how this works but try this.
    Replace this line.
    Print #1, Asc(theletter) Xor finalkey; <<<<<<- Here

    With this line:
    Print #1, Asc(theletter) Xor Left(finalkey, 9)

    I have not used Xor before and I am not overly sure what it is supposed to return..I thought true or false. My deduction was that the right side was too large and by bring
    it down in size it should work...this works but I am not sure if it is what you are looking for..

    Worth a shot...
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

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