$i = 0 Do If Random() < 0.5 Then $Letter = Chr(Random(Asc("A"), Asc("Z"))) Else $Letter = Chr(Random(Asc("a"), Asc("z"))) Endif $i = $i + 1 Until $i = 8 Msgbox(4096, "Random Letters", $Letter)
Little help with Random
Started by
MattX
, Jan 14 2005 01:01 PM
2 replies to this topic
#1
Posted 14 January 2005 - 01:01 PM
I have used exsisting code in the help file to generate a random letter, I have added a loop too so it does it 8 times. My problem is [ and I have many ] is how do I get the $letter to increase so it adds all the letters together...? I hope that made sense - Basically I need a 8 letter only random password.
#2
Posted 14 January 2005 - 01:15 PM
Think I've done it - I found someone elses loop:
Still not 100% sure how the For and Next works in this.....
Dim $i = 0, $word = "" For $i = 1 to 10 If Random() < 0.5 Then $Letter = Chr(Random(Asc("A"), Asc("Z"))) Else $Letter = Chr(Random(Asc("a"), Asc("z"))) Endif $word = $word & $letter Next Msgbox(4096, "Random Letters", $word)
Still not 100% sure how the For and Next works in this.....
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users




