Opened on Jun 1, 2022 at 4:59:05 PM
Last modified on Mar 17, 2024 at 4:27:01 PM
#3890 assigned Feature Request
Array Comparison — at Version 3
| Reported by: | J-Paul Mesnage | Owned by: | J-Paul Mesnage |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description (last modified by )
I notice that "if $array = $array" return False
so using the following script
Local $array1 = [1,2,3,4] Local $array2 = [4,5,6] Local $array2_same = [4,5,6] Local $array2_copy = $array2 ConsoleWrite("comparison not sensitive (=)" & @CRLF) If $array1 = $array1 Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array1 = $array1" & @CRLF) If NOT($array1 = $array2) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array1 != $array2 ==== current release 3.3.16.0 ====" & @CRLF) If NOT($array2 = $array2_same) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array2 != $array2_same ==== current release 3.3.16.0 ====" & @CRLF) If $array2 = $array2_copy Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array2 = $array2_copy" & @CRLF) ; comparison sensitive so all different ConsoleWrite(@CRLF & "comparison sensitive (==) so all different" & @CRLF) If NOT($array1 == $array1) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array1 <> $array1" & @CRLF) If NOT($array1 == $array2) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array1 <> $array2" & @CRLF) If NOT($array2 == $array2_same) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array2 <> $array2_same" & @CRLF) If NOT($array2 == $array2_copy) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array2 <> $array2_copy" & @CRLF) ConsoleWrite(@CRLF & "modification of $array2_copy[2], so it will be different" & @CRLF) $array2_copy[2] = 7 ; modification so it will be different If Not ($array2 = $array2_copy) Then ConsoleWrite ('@@ Debug(' & @ScriptLineNumber & ") $array2 != $array2_copy ==== current release 3.3.16.0 ====" & @CRLF)
I get under current release 3.3.16.0
comparison not sensitive (=) @@ Debug(11) $array1 != $array2 ==== current release 3.3.16.0 ==== @@ Debug(12) $array2 != $array2_same ==== current release 3.3.16.0 ==== comparison sensitive (==) so all different modification of $array2_copy[2], so it will be different @@ Debug(24) $array2 != $array2_copy ==== current release 3.3.16.0 ====
so I propose to be more consistant when comparing array's
comparison not sensitive (=) @@ Debug(10) $array1 = $array1 @@ Debug(11) $array1 != $array2 ==== current release 3.3.16.0 ==== @@ Debug(12) $array2 != $array2_same ==== current release 3.3.16.0 ==== @@ Debug(13) $array2 = $array2_copy comparison sensitive (==) so all different @@ Debug(17) $array1 <> $array1 @@ Debug(18) $array1 <> $array2 @@ Debug(19) $array2 <> $array2_same @@ Debug(20) $array2 <> $array2_copy modification of $array2_copy[2], so it will be different @@ Debug(24) $array2 != $array2_copy ==== current release 3.3.16.0 ====
Change History (3)
comment:1 by , on Jun 1, 2022 at 4:59:28 PM
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:3 by , on Jun 2, 2022 at 11:13:11 AM
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.

Fix sent to Jon