RadovanJ Posted November 13, 2008 Posted November 13, 2008 Hello, i want use password generating function like this: MsgBox(0,"Generated Password is:", genPassword(8)) Func genPassword($length) $array = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789","") $newPassword = "" For $X = 1 to $length $newPassword &= $array[Random (1, $array[0], 1)] Next return $newPassword EndFunc for getting and using generated random password, inside autoit script. But I don“t know how can i write function output to variable for future use. Can anyone help me with this beginner stupid question ? I can only write result to Message box, just as it is above. Tank you Radovan J.
Robjong Posted November 13, 2008 Posted November 13, 2008 Not sure if this is what you mean. Global $sGenPass $sGenPass = _GeneratePassword(8) MsgBox(0, "Generated Password is:", $sGenPass) ConsoleWrite("Generated Password is:" & $sGenPass & @CRLF) Func _GeneratePassword($iLength) Local $aArray = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", "") $sPassword = "" For $X = 1 To $iLength $sPassword &= $aArray[Random(1, $aArray[0], 1)] Next Return $sPassword EndFunc ;==>genPassword
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