<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !DIC.-Delimited Item Commands > DIC.Format_Numeric |
MiniRobotLanguage (MRL)
DIC.Format_Numeric
Format delimited Fields in a Line in the same way like with FMT.
Intention
Assume you a line containing some Floating-Point Numbers. Now if you convert them to TAB-separated Text, they may be badly formatted if they do not have an equal length.
Use this Command to format specified Numeric Data in a line.
VAR.$$LIN=2022/07/19$tab$03:44:06$tab$-32.4$tab$-12.0$tab$-12.0$tab$-17.7$tab$36.7$tab$377
VAR.$$DEL=$tab$
VAR.$$IND=4,5,6,7
' For more Options see FMT.-Command
VAR.$$FMT=00.00
' Now we call the command
DIC.Format_Numeric|$$LIN|$$DEL|$$IND|$$FMT|$$RES
' And Debug-Print the Result 27
DBP.$$LIN$crlf$$$RES
ENR.
Result:
Syntax
DIC.fnu|P1|P2|P3|P4[|P5][|P6]
DIC.Format_Numeric|P1|P2|P3|P4[|P5][|P6]
Parameter Explanation
P1 - Field Index can be a number like 1,2,3 (makes no sense anyway) or a Letter like "A", "AB". Letters must be enclosed in " ".
P2 - (optional) Variable for Result. If omitted result is placed on TOS.
Example
'***********************************
'
'***********************************
Remarks
-
Limitations:
-
See also:
•1.5.2 Working with Text-Strings
•VAR. - Variable Set Value/Clear
•IVS. / NVS. - If-Variable-String
•SBD. - String between Delimiter
•SBM. - String between Delimiter-Multiple