random code?

Results 1 to 3 of 3

Thread: random code?

  1. #1
    Join Date
    Dec 1969

    Default random code?

    any idea how to create a ramdon code. eg. AAA34 etc?

  2. #2
    Join Date
    Dec 1969

    Default Come on....

    "Randomize" and "Rnd" should be enough.<BR><BR>Aren&#039;t there any articles you can find on this? I am SURE that a search on Google would find some.

  3. #3
    Join Date
    Dec 1969

    Default This should get you started...

    strCode = ""<BR>Randomize<BR>for i = 1 to intChars<BR> strCode = strCode & chr(Int((asc("Z") - asc("A") + 1) * Rnd + asc("A")))<BR>next<BR><BR>This only generates codes with random uppercase letters. Your mission, should you choose to accept it, is to get it to generate letter/number combinations. It&#039;s a bit more tricky because the ASCII codes for numbers and letters aren&#039;t contiguous. Have a look at http://www.asciitable.com/<BR>

Posting Permissions

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