SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Posts rarely lloydi's Avatar
    Join Date
    Jan 2002
    Location
    Swindon UK
    Posts
    620
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reminder about character numbers

    I need to create a script that randomly creates an ID - a fifteen digit alphanumeric string (which may also contain a dash).

    In my mind I have something that loops from 1 to fifteen, and within that loop creates a random number. This trandom number is used to create a character by using a char number. Trouble is, I cannot remember the syntax for this. I thought it was something like

    strID = strID + chr245

    Simple little question really, hopefully someone can clarify for me?

    Thanks muchly
    Build Your Own Web Site the Right Way!
    A beginners' HTML/CSS book with web standards at its heart
    The Ultimate HTML Reference
    A complete reference, in glorious hardback

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.developer.irt.org/script/343.htm

    That'd do you.

    But if you want to use it as a unique id - you're best off using something based on date so that it's unique.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


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
  •