|
<< 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 |
MiniRobotLanguage (MRL)
ATA.Add to Array
Add Element to Array/Collection
Intention
Use this command just like the ATC command to add an element to an array or collection. The difference from the ATC. command is that no check is performed to see if such an element already exists in the array or collection. Therefore, the same element can be added multiple times to an array or collection. This would not be possible with the ATC . command, as it checks for duplicate elements. Elements can be preprocessed before storage, with options "f", "i", and "tlu" available. However, if options "f" and "i" are used, sorting the array will no longer work, as storage occurs in a binary format.
Syntax
ATC.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 - The element or "word" to be added to the collection. P2 can contain any characters.
P3 - (optional) The element can be treated as:
"f" - floating point number with a range of approximately +/- 3.4*10^-4932 to 1.2*10^4932, and offer 18 digits of precision
"i" - 64-bit Integer number with a range of -9.22x10^18 to 9.22x10^18 ( -2^63 to 2^63 -1)
"t" - Trim String before store.
"l" - Lower-Case-Trim String before store.
"u" - Upper-Case-Trim String before store.
You need to use the "f" and "i" options also when you take the Elements out of the Array / Collection if you used them to put the elements in.
You do not need to use the "t","l" and "u" option two times. You can use them either when you fill the Array or when you take things out.
Example
'***********************************
' ATC.-Sample
'***********************************
' This will reset the Collection "0"
CLC.0
' Now we add the Element "Heinz" two times to the Collection/Array
$$NEW=Heinz
ATA.0|$$NEW
$$NEW=Heinz
ATA.0|$$NEW
CGC.0|$$NUM
DBP.Collection 0 contains $$NUM Elements.
CGC.1|$$NUM
DBP.Collection 1 contains $$NUM Elements.
ENR.
Remarks
-
Limitations:
-
See also:
• CFV. - Collection from Variable
• CTV. - Collection to Variable
• RFC. - Remove from Collection