|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > !Collections/Fast Arrays > Collection-Commands > Smart Package Robot 's Collection Commands |
MiniRobotLanguage (MRL)
FEC. - For Each Collection-Item
Enumerate Collection-Items
Intention
FEC., an acronym for "For Each Collection Item," is a command that iteratively processes each item in a specified collection.
This command simplifies operations that need to be performed on individual elements, such as data transformation, analysis, or output.
FEC. enhances the automation of operations on collections, reducing the need for manual iteration coding.
It works with both, Type-1 and Type-2 collections, suitable for various data types and complex structures.
FEC. is essential for tasks requiring individual item processing within a collection.
The primary function of FEC. is to streamline the handling of collection items by automatically iterating through them. It places each item into a designated variable and then performs a subroutine call, typically for processing or output.
FEC. can be used with Type 2 Collections - where it may make less sense because the stored Data is "Binary".
Syntax
FEC.P1|P2|P3
Parameter Explanation
P1 - Label where the for each will jump "for each Collection item"
P2 - Temp. Variable, updated by FEC each round.
P3 - Collection number 0 - 2048*
*Collection Type 1: "Word-Collections".
They are numbered from 0 to 1024.
Collection Type 2: "Checksum-Collections".
They are numbered from 1025 to 2048.
Example
'***************************************************************
' Testing Script for FEC. with Type 2 Collection
'***************************************************************
' Initialize collection 0 and ensure it's empty
VAR.$$C00=1030
CLC.$$C00
DBP.Initializing and clearing collection 0.
' Add unique elements to the collection
VAR.$$N11=John
ATC.$$C00|$$N11
GSB.Outp
VAR.$$N11=Jane
ATC.$$C00|$$N11
GSB.Outp
VAR.$$N11=Rolf
ATC.$$C00|$$N11
GSB.Outp
DBP.Unrolling Elements
FEC.DoIt|$$TXT|$$C00
:end_script
DBP.All elements correctly verified. Test concluded.
' End of script
ENR.
:DoIt
DBP.$$TXT
RET.
:Outp
GMD.l|$$N11|$$OCS
DBP.Added $$N11 to collection 0.
DBP.$$OCS
RET.

Here you can see the Textual representation of the Type-2 Collection Checksums.
'***************************************************************
' Testing Script for FEC. with Type 1 Collection
'***************************************************************
' Initialize collection 0 and ensure it's empty
VAR.$$C00=0
CLC.$$C00
DBP.Initializing and clearing collection 0.
' Add unique elements to the collection
VAR.$$N11=John
ATC.$$C00|$$N11
GSB.Outp
VAR.$$N11=Jane
ATC.$$C00|$$N11
GSB.Outp
VAR.$$N11=Rolf
ATC.$$C00|$$N11
GSB.Outp
DBP.Unrolling Elements
FEC.DoIt|$$TXT|$$C00
:end_script
DBP.All elements correctly verified. Test concluded.
' End of script
ENR.
:DoIt
DBP.$$TXT
RET.
:Outp
DBP.Added $$N11 to collection 0.
DBP.$$N11
RET.

Remarks
-
Limitations:
-
See also:
• CFV. - Collection from Variable
• CTV. - Collection to Variable
• RFC. - Remove from Collection