Smart Package Robot 's Collection Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > !Collections/Fast Arrays > Fast Array-Commands >

 Smart Package Robot 's Collection Commands

ASO. Array Sort Order

Previous Top Next


MiniRobotLanguage (MRL)

 

ASO.Array Sort Order

Sort Array Elements

 

 

Intention

 

This command is used to sort arrays or collections. The sorting can be done in ascending or descending order, depending on the specification of parameter P2.

Sorting will not work for elements stored as floating-point or integer using "i" or "f" options because these are stored binary, but only for string arrays.

 

 

Syntax

 

 

ASO.P1[|P2]

 

 

Parameter Explanation

 

P1 - The collection identifier, typically a numeric value or a variable that contains a number from 0 to 1024/1025 to 2048.

P2 - (optional)  0 or 1;  
       "0" - ascending Sort,

         "1" - descending Sort

 

 

 

Example

 

'***********************************

' ATC.-Sample

'***********************************
' This will reset the Collection "0"

CLC.0

' Now we add the Element Heinz" to the Collection

$$NEW=Heinz

ATC.0|$$NEW

 

CGC.0|$$NUM

DBP.Collection 0 contains $$NUM Elements.

 

CGC.1|$$NUM

DBP.Collection 1 contains $$NUM Elements.

ENR.

 

 

 

Remarks

 

-

 

 

Limitations:

Sorting will currently not work for elements stored as floating-point or integer values, but only for string arrays.  

 

See also:

 

ATC. - Add to Collection

CFV. - Collection from Variable

CGC. - Collection Get Count

CLC. - Clear Collection

CTV. - Collection to Variable

JIU. - Jump if Unique

JNU. - Jump Not Unique

RFC. - Remove from Collection