Navigation:  ThinBASIC Modules > Core (thinBasic Core Engine) > Array functions >

ARRAY UNIQUE

Previous pageReturn to chapter overviewNext page

 

Description

 

Sort MainArray. Find unique values in MainArray and fill DestinationArray with unique values found in MainArray.

 

Syntax

 

ARRAY UNIQUE MainArray, DestinationArray [, {ASCEND | DESCEND} [, CountArray ]]

 

Returns

 

None

 

Parameters

 

Name

Type

Optional

Meaning

MainArray

Array

No

Name of the variable array containing elements to be checked.

Attention: this array will be sorted according with the sort indication

DestinationArray

Array

No

The element index inside the array from which to start assignment.

Attention: this array will be automatically free and resized

CountArray

Array

Yes

Optional numeric array.

If present, this array will be free and re dimensioned with the same number of elements of DestinationArray. Each element of CountArray will contain a numeric value indicating how many times the corresponding key element in DestinationArray has been found in MainArray.

 

Remarks

 

Restrictions

 

MainArray and DestinationArray must be dynamic string arrays.

CountArray (if present) must be numeric, any numeric data type but consider number overflow when defining it.

 

See also

 

LBound, UBound, ARRAY SORT,

 

Examples