|
<< 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)
AIE.Array Insert Element
Add Element to Array/Collection, move all subsequent Elements forward and Redim Array
Intention
This command adds elements to an array or a collection at the position specified in the P2 parameter.
The other elements that come after this new element are moved one to the right and the internal size of the array is increased by one element (Auto-Redim).
Syntax
AIE.P1|P2|P3[|P4]
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-Index Number from 1 ... (number of Elements in Array). This Command is 1 - based command.
P3 - The element or "word" to be inserted to the collection. P3 can contain any characters can also be Binary.
P4 - (optional) The element can be treated (pre-processed) 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
'***********************************
' AIE.-Sample
'***********************************
' This will reset the Collection "0"
CLC.0
' Now we add Elements to the Collection
$$NEW=Heinz
ATC.0|$$NEW
$$NEW=Peter
ATC.0|$$NEW
$$NEW=Karl
ATC.0|$$NEW
CGC.0|$$NUM
DBP.Collection 0 contains $$NUM Elements.
' We insert Heino at the first place
$$NEW=Heino
AIE.0|1|$$NEW
CGC.0|$$NUM
DBP.Collection 0 contains $$NUM Elements.
ENR.
Remarks
-
Limitations:
-
See also:
• CFV. - Collection from Variable
• CTV. - Collection to Variable
• RFC. - Remove from Collection