lolp1 Posted August 4, 2007 Posted August 4, 2007 Didn't see a random func in the help file for letters, only numbers. Any UDF's out there for it?
Glyph Posted August 4, 2007 Posted August 4, 2007 Didn't see a random func in the help file for letters, only numbers. Any UDF's out there for it?May i ask what for? tolle indicium
Generator Posted August 4, 2007 Posted August 4, 2007 (edited) StringUpper(Chr(Random(65,90,1))) ;All Caps StringLower(Chr(Random(65,90,1))) ;Not caps Edited August 4, 2007 by Generator
lolp1 Posted August 4, 2007 Author Posted August 4, 2007 May i ask what for?To create a random account name.StringLower(Chr(Random(65,90,1))) ;Not capsHow to generate around 6-8 random chars in one string?
Developers Jos Posted August 4, 2007 Developers Posted August 4, 2007 How to generate around 6-8 random chars in one string?Use a loop .... and append a character in every cycle of the loop. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
lolp1 Posted August 4, 2007 Author Posted August 4, 2007 Use a loop .... and append a character in every cycle of the loop.Would be fairly lengthy no? Is there a faster way?Got an example of what you mean? Cause the way I'm thinking would take a second or two to generate 7 chars
Generator Posted August 4, 2007 Posted August 4, 2007 Global $Name[8] $TimeIni=TimerInit() For $i= 0 to UBound($Name,1)-1 $Name[$i]=StringLower(Chr(Random(65,90,1))) Next $Time=TimerDiff($TimeIni) _ArrayDisplay($Name)
lolp1 Posted August 4, 2007 Author Posted August 4, 2007 This is very weird there is no easier way to get a random letter of 6 characters. The end goal is to obtain a random 6 letters in one string, and then store it to a variable. (So I can send it later on) Send($variable..)
Developers Jos Posted August 4, 2007 Developers Posted August 4, 2007 $tm = TimerInit() $String1 = GetRandomString(6,8) $String2 = GetRandomString(6,8) ConsoleWrite("Time:" & TimerDiff($tm) & " String1:" & $String1 & " String2:" & $String2 & @CRLF) Func GetRandomString($min=1,$max=8) Local $retString For $x = 1 to int(Random($min,$max+1)-.5) $retString &= StringLower(Chr(Random(65,90,1))) Next Return $retString EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
lolp1 Posted August 4, 2007 Author Posted August 4, 2007 Works faster then I thought... thanks, works fine.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now