Orbiter Posted June 28, 2011 Posted June 28, 2011 $Len = StringLen($Result) Msgbox(0,"",$Len) If $Len < 8 Then $digits = 8 - $Len For $i = 1 To $digits $aSpace[0] = Chr(Random(97, 122, 1)) ;a-z $aSpace[1] = Chr(Random(48, 57, 1)) ;0-9 $aSpace[2] = Chr(Random(65, 90, 1)) ;A-Z $Adder &= $aSpace[Random(0, 3)] Next $Result = $Result & $Adder Else EndIf Return $Result EndFunc ;==>_Password I suspected that my StringLen wasn't working as it should so I debugged it with a Msgbox. The strange thing is: 1. The msgbox pops up two times. Once with $Len as 0, the second time with $Len as the real stringlength of $Result. What causes this "loop"? Why is $Len 0 the first time?
jaberwacky Posted June 28, 2011 Posted June 28, 2011 Only thing I can figure is that you have another msgbox somewhere in your script that you forgot about. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
MvGulik Posted June 28, 2011 Posted June 28, 2011 Odd function start code you got there. $Len = StringLen($Result) ... EndFunc ;==>_Password "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
smartee Posted June 29, 2011 Posted June 29, 2011 Maybe length was really equal to 0 at that point, and its likely you have another MsgBox(), hard to help with so little code. More code=More help
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