|
<< 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)
ADE.Array Delete Element
Delete Element from Array/Collection, move all subsequent Elements backward and Redim Array
Intention
You can use this command to delete elements from an array or collection by simply specifying the index of the element.
The index is a number from 1 to the number of elements, i.e. simply the number of the desired element.
The difference to the RFC. command is that with the RFC command the element name, i.e. the value of the element, is specified, whereas with this command the index, i.e. the memory location of the element, is used.
Please read the general information about Collections and Fast Arrays.
Syntax
ADE.P1|P2[|P3]
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. This is the first Element to be deleted.
P3 - (optional) Number of Elements to be deleted. If omitted only 1 Element is deleted. If P3 = 0 or P3 = 1, only 1 Element is deleted.
IF P3 = 2 then the selected (P2) and the next Element are deleted. If P3 is equal to the "Count of Elements" then all Elements are deleted.
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.
' Delete this one Element.
ADE.1|1
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