layer Posted January 13, 2005 Posted January 13, 2005 hello... is there a way to use the Random function with letters, like: Random (a, z) or is there a work around to this to get random letters? thanks!! FootbaG
CyberSlug Posted January 13, 2005 Posted January 13, 2005 Straight from the help file example: ;Random letter If Random() < 0.5 Then ;Capitals $Letter = Chr(Random(Asc("A"), Asc("Z"), 1)) Else ;Lower case $Letter = Chr(Random(Asc("a"), Asc("z"), 1)) Endif If you want a bunch of letters, simply put in a loop: Dim $i, $word = "" For $i = 1 to 10 ;INSERT ABOVE CODE HERE $word = $word & $letter Next MsgBox(4096,"Result", $word) Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
layer Posted January 13, 2005 Author Posted January 13, 2005 thanks CS :"> im just a little out of it from a huge test that determined my future today FootbaG
layer Posted January 13, 2005 Author Posted January 13, 2005 hmmm... actually doesnt work, because theres only one paremeter in Chr () and there is 3 in the help files example, so i get the error message: "Error parsing function call." sorry im really really tired if there is somthing big im missing... FootbaG
CyberSlug Posted January 13, 2005 Posted January 13, 2005 Hmm, works for me. I'm using the current AutoIt beta version, though. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Griff Posted January 13, 2005 Posted January 13, 2005 This didn't work for me either, looks like its an addition to the new beta then to have steps in the random function. I just removed the 3rd variable from each. ;Random letter If Random() < 0.5 Then ;Capitals $Letter = Chr(Random(Asc("A"), Asc("Z"))) Else ;Lower case $Letter = Chr(Random(Asc("a"), Asc("z"))) Endif
Wolvereness Posted January 13, 2005 Posted January 13, 2005 (edited) Cyber, I think it has to do with the random() additions and decimals... I'm going to the online doc to look at it... Edited January 13, 2005 by Wolvereness Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote]
layer Posted January 13, 2005 Author Posted January 13, 2005 maybe i dont have the up-to-date beta, but i know im using it, ill check when i get back from school.. FootbaG
layer Posted January 13, 2005 Author Posted January 13, 2005 This didn't work for me either, looks like its an addition to the new beta then to have steps in the random function. I just removed the 3rd variable from each.;Random letter If Random() < 0.5 Then ;Capitals $Letter = Chr(Random(Asc("A"), Asc("Z"))) Else ;Lower case $Letter = Chr(Random(Asc("a"), Asc("z"))) Endif<{POST_SNAPBACK}>thanks works great! FootbaG
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