StungStang Posted August 27, 2011 Share Posted August 27, 2011 Hi to all, i have a new request to autoit guru For example i have 6 variable, this variable contains string. Now i have to check if ALL all variables different from each other. It's very annoying to do that with a huge IF THEN, even if the variable are much more tha 6. There is a simple way to do this? Hi! Link to comment Share on other sites More sharing options...
MvGulik Posted August 27, 2011 Share Posted August 27, 2011 (edited) Drop your variable(s) data into a array and use that array in a scanning loop. Something* like this should do the trick. (*Process) $fFailed = False For $iSearchFor = $iFirst To $iLast-1 For $iCompare = $iSearchFor+1 To $iLast if $aArray[$iSearchFor] == $aArray[$iCompare] then $fFailed = True ;; '==' is string enforced + case sensitive compare. Next Next Edited August 27, 2011 by iEvKI3gv9Wrkd41u "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 ... Link to comment Share on other sites More sharing options...
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