Modify

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 mvg, 15 years ago

"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")

$aArray = [1,2,3,4,5,1,2,3,4,5]  [Array|10]
$aNewArray = [5,"1","2","3","4","5"]  [Array|6]

hehe

Oh yea, real reason.

$iDimension [[optional] The Dimension of the Array to use

1 - double "[" character typo.
2 - dimension?, Field/Column (or Row?, I'm never sure about those.) sound more appropriate.

comment:2 by Jon, 15 years ago

Resolution: Wont Fix
Status: newclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.