Jump to content
Sign in to follow this  
au3scr

random

Recommended Posts

au3scr

How to use random with chr?

I want use random characters

I found Asc("A"), Asc("Z"), but it returns the number,how i can make ranom with text symbols a..z

for chr it returns 0

Edited by au3scr

Share this post


Link to post
Share on other sites
monoceres

That would be Chr(Random(65,90,1))


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
spudw2k

Use Chr() to convert a character code into a character. 65-90 is A-Z and 97-122 is a-z.

$rnd = Random(65,90,1)
msgbox(0,Chr($rnd),"")
Edited by spudw2k

Share this post


Link to post
Share on other sites
au3scr

than you, how to get mre than 1 char?


Share this post


Link to post
Share on other sites
weaponx

@au3scr - Haven't you been asking questions long enough to answer this yourself?

$rnd = ""

For $X = 0 to 8

$rnd &= Chr(Random(65,90,1))

Next

msgbox(0,"",$rnd)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×