Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#1842 closed Bug (Duplicate)

_ArrayUnique does not work properly

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

; *
; Example 1 - Declare a 1-dimensional array, that contains duplicate values.
; Use _ArrayUnique to Create a New Array that only contains the unique values.
; *
#include <Array.au3>
Dim $aArray[10] = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
_ArrayDisplay($aArray, "$aArray")
$aNewArray = _ArrayUnique($aArray) ;Using Default Parameters
_ArrayDisplay($aNewArray, "$aNewArray represents the 1st Dimension of $aArray")

Attachments (0)

Change History (4)

comment:1 by mvg, 15 years ago

Duplicate of ticket #1806. (No bug)

_ArrayUnique() Doc on $iBase parameter say's

Parameters
$iBase [optional] Is the Array 0-base or 1-base index. 0-base by default

This is for telling the function about the input array. And it not used/intended to control the format of the output array.

As stated in the Remark part of the _ArrayUnique() help.

Returns an array, the first element ($array[0]) contains the number of strings returned, the remaining elements ($array[1], $array[2], etc.) contain the unique strings.

Still no bug.
Only thing left is to put in a Request for a change, and elaborate on the why.

  • - -

?: maybe making the help text on the $iBase parameter more specific by adding "input" to it,

$iBase [optional] Is the input Array 0-base or 1-base index. 0-base by default

comment:2 by J-Paul Mesnage, 15 years ago

Resolution: Duplicate
Status: newclosed

comment:3 by Thopaga, 15 years ago

Hello.
Have I misunderstood?
Look at the result I get.
There is a duplicate row with value 5.
Thanks.

[0]|5
[1]|1
[2]|2
[3]|3
[4]|4
[5]|5

comment:4 by Thopaga, 15 years ago

Dear Sir.
Sorry, that I did not understand.
No error, only my misunderstanding (not english speaking though).
Thanks for clearing up.
Regards Thopaga.

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.