youtuber Posted November 16, 2016 Posted November 16, 2016 (edited) Hello how can I find if the word or sentence is not the same? #include <Array.au3> $a1[0] = "autoit0" $a1[1] = "autoit0123asdf" $a1[2] = "autoit0" $a1[3] = "autoit0" $a1[4] = "autoit0" $b2[0] = "autoit0" $b2[1] = "autoit0" $b2[2] = "autoit0" $b2[3] = "autoit0" $b2[4] = "autoit0" For $x = 0 To UBound($a1) - 1 For $y = 0 To UBound($b2) - 1 ConsoleWrite($a1[$x] & " " & $b2[$y] & @CRLF) If StringLen($a1[$x], $b2[$y]) <> Then ;If StringLen($a1[$x], $b2[$y]) Then ConsoleWrite($a1[$x] & " Characters are not the same " & $b2[$y] & @CRLF) EndIf Next Next Edited November 16, 2016 by youtuber
jdelaney Posted November 16, 2016 Posted November 16, 2016 stringcompare or just a straight comparison with == youtuber 1 IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
kylomas Posted November 16, 2016 Posted November 16, 2016 youtuber, Assuming both arrays are the same length and you are comparing relative offsets one to one... #include <Array.au3> local $a1[5], $b2[5] $a1[0] = "autoit0" $a1[1] = "autoit0123asdf" $a1[2] = "autoit0" $a1[3] = "autoit0" $a1[4] = "autoit0" $b2[0] = "autoit0" $b2[1] = "autoit0" $b2[2] = "autoit0" $b2[3] = "autoit0" $b2[4] = "autoit0" For $x = 0 To UBound($a1) - 1 ConsoleWrite($a1[$x] & ' = ' & $b2[$x] & ($a1[$x] = $b2[$x] ? ' are ' : ' are not ') & ' equal' & @CRLF) Next kylomas youtuber 1 Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
youtuber Posted November 17, 2016 Author Posted November 17, 2016 Thank you for your reply How can I do it to use If Then instead of ConsoleWrite? If $a1 AND $b2 == Then etc.
kylomas Posted November 17, 2016 Posted November 17, 2016 (edited) youtuber, It has nothing to do with consolewrite. I suspect you are asking for a translation of the ternary expression, like this? #include <Array.au3> local $a1[5], $b2[5] $a1[0] = "autoit0" $a1[1] = "autoit0123asdf" $a1[2] = "autoit0" $a1[3] = "autoit0" $a1[4] = "autoit0" $b2[0] = "autoit0" $b2[1] = "autoit0" $b2[2] = "autoit0" $b2[3] = "autoit0" $b2[4] = "autoit0" For $x = 0 To UBound($a1) - 1 if $a1[$x] = $b2[$x] then ConsoleWrite('equal' & @CRLF) Else ConsoleWrite('not equal' & @CRLF) endif Next kylomas What do you mean by this? If $a1 AND $b2 == Then Edited November 17, 2016 by kylomas question youtuber 1 Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
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