<< Click to Display Table of Contents >> Navigation: 3. Script Language > FEX. - Enumerations > Enumerations Commands (FEX) |
MiniRobotLanguage (MRL)
FEV. Enumeration Command
For each Variable
Intention
Enumerate all lines in a given variable.
Checks first if the Lines are delimited with CR,LF or CRLF and chooses the right Line-Separator.
If you load a complete Text-file into a variable using CFF. (Copy from file), you can go through each line of the text very fast, using FEV.
As FEV. work in Memory, its much faster then FEL. (For each line) that works on the file-system.
Syntax
FEV.P1|P2|P3[|P4]
Parameter Explanation
P1 - Label where the for each will jump "for each element"
P2 - Temp. Variable, updated by FEX each round.
P3 - Variable with Text
P4 - optional Standard-Pattern
Example
'**********************************************
' FEV-Sample
'**********************************************
VAR.§§FIL=?desktop\2Line.txt
CFF.§§FIL|§§FIA
PRT.§§FIA
PRT.***************************************
FEV.:Tar|$$VAR|§§FIA|Line
:over
MBX.Halt to read output
END.
:Tar
PRT.$$VAR
RET.
'*****************************************************
' EXAMPLE 2: FEV./CTI./CFI. Enumerate INI-File
'*****************************************************
VAR.§§FIL=?desktop\one.ini
VAR.§§SEC=Section
VAR.§§KEY=Key
VAR.$$BLO=ABCDEFGHIJ
VAR.§§VAL=MyValue
' First we write to a ini-file
FOR.§§CNT|1|3
: §§SEA=§§SEC_§§CNT
FOR.§§CNX|1|5
DBP.§§SEA
CTI.§§FIL|§§SEA|§§KEY_§§CNX|§§VAL#dtime#|§§RES
IVV.§§RES=1
DBP. Ini was written with success!
ELS.
DBP. Ini was NOT written with success!
EIF.
NEX.
NEX.
' Now we read all Section-Names
CFI.§§FIL|§§MYS
PRT.Section-Names:$crlf$§§MYS
FEV.doit|§§SKA|§§MYS
MBX.Ready
ENR.
:doit
' Get all Keyf from that section
CFI.§§FIL|§§SEA|§§MYK
PRT.Key-Names from §§SKA:$crlf$§§MYK
' Enumerate all Keys also
PRT. Key-Enumeration:
FEV.doitb|§§SIK|§§MYK
RET.
:doitb
CFI.§§FIL|§§SKA|§§SIK|§§VAL
PRT. Key: §§SIK Value=§§VAL
RET.
Remarks
FEV. is a Member of the FEX-Family "For Each X". They are used for easy enumeration.
Limitations:
-
See also:
• 3.1 Systemvariables especially: #fex#, #fxd# . etc.