Opened 15 years ago
Closed 15 years ago
#1921 closed Bug (Wont Fix)
_ArrayUnique
| Reported by: | BrewManNH | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | Documentation | |
| Version: | 3.3.6.1 | Severity: | None |
| Keywords: | Cc: |
Description
It states in the help file that _ArrayUnique "Returns the Unique Elements of a 1-dimensional array.", fundamentally this is incorrect. What _ArrayUnique does is it returns a 1-dimensional array, while the incoming array can be multi-dimensioned. If you use the $iDimension parameter you can tell it to only return the unique items on whichever column you'd like.
See the example below, it will return the unique items from the 3rd column (first column is 1 when using _ArrayUnique)
#include <Array.au3> Local $Array[4][6] = [["FirstName", "LastName", "IDNumber", "Location", "Grade", "Action"],["john", "smith", "111222", "Denver", "2", "enroll"],["jack", "jones", "333444", "denver", "4", "withdraw"],["jack", "jones", "333444", "lasvegas", "4", "enroll"]] _ArrayDisplay($Array) $Array = _ArrayUnique($Array, 3) _ArrayDisplay($Array)
It would be nice if the documentation could be changed to reflect the true usage of the function.
Attachments (0)
Change History (2)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
| Resolution: | → Wont Fix |
|---|---|
| Status: | new → closed |

"Returns the Unique Elements of a 1-dimensional array."
Not to mention the fact that is not returning "the Unique elements", but returning a version of the input with the duplicates removed. ("make elements unique" versus "give unique elements from set")
hehe
Oh yea, real reason.
1 - double "[" character typo.
2 - dimension?, Field/Column (or Row?, I'm never sure about those.) sound more appropriate.