locked
Random letter or a random number RRS feed

  • Question

  • How do I get a random letter or a random number in small basic. I can only find them separately but I need it to be one command.

    Thanks

    Monday, March 2, 2015 5:02 PM

Answers

  • you can do:

    txt="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

    char=Text.GetSubtext(txt,Math.GetRandomNumber(36),1)

    You can even add the lower case letters and select one of the 62.



    Jan [ WhTurner ] The Netherlands

    • Proposed as answer by Ezra94 Tuesday, March 3, 2015 12:04 AM
    • Marked as answer by el portugal Wednesday, March 4, 2015 4:55 PM
    Monday, March 2, 2015 6:30 PM
    Answerer

All replies

  • you can do:

    txt="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

    char=Text.GetSubtext(txt,Math.GetRandomNumber(36),1)

    You can even add the lower case letters and select one of the 62.



    Jan [ WhTurner ] The Netherlands

    • Proposed as answer by Ezra94 Tuesday, March 3, 2015 12:04 AM
    • Marked as answer by el portugal Wednesday, March 4, 2015 4:55 PM
    Monday, March 2, 2015 6:30 PM
    Answerer
  • Thank you this really helped!

    Wednesday, March 4, 2015 5:01 PM