+ Reply to Thread
Results 1 to 7 of 7

Faulty Code

  1. #1
    Registered User
    Join Date
    02-10-2008
    Posts
    8

    Exclamation Faulty Code

    I have a project for my Cryptology class and I can't find a fault in my code. I even asked my classmate to see if anything was wrong and he said my code was essentially the same as his. I'm looked over it several times and I was hoping someone here could help me spot my mistake. For background information, this code is supposed to decrypt (bits to text) and encrypt (text to bits). If you see nothing wrong here, could you please check out the file I attached? It contains my entire code. Thanks to anyone who tries!

    Here's the code:

    'Encrypts input text to bits and then outputs it
    Please Login or Register  to view this content.
    (Btw, in my txt file, I know the decryption program doesn't work, but I'm positive that has nothing to do with the error.)
    Attached Files Attached Files
    Last edited by gizoku00; 04-07-2008 at 09:32 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Please edit your post to add code tags.

  3. #3
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-10-2008
    Posts
    8
    txtPlain is a textbox in a userform, so I don't think that's the problem, since the statment "Dim txtPlain as String" can be omitted

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    TxtPlain is not referencing a forms TextBox unless this code is in a Form module.

    I suggest you put Option Explicit at the top of the module and declare all your variables, then step through the code.

  6. #6
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245
    Quote Originally Posted by gizoku00
    txtPlain is a textbox in a userform, so I don't think that's the problem, since the statment "Dim txtPlain as String" can be omitted
    Who's talking about txtplain ? I was referring to txtbit Does txtbit gets some data from somewhere.

    It's difficult, if you don't provide the whole picture, to determine if every variable has the necessary input.

    Charlize

  7. #7
    Registered User
    Join Date
    02-10-2008
    Posts
    8
    Sorry about that, I should've cleared that up (and should've read right too ) Anyways, thanks to both of you, I realized the problem was my exclusion of some variable declarations and an important function.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1