<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !Format Strings > String Operations |
MiniRobotLanguage (MRL)
VSL. Command
Variable Set Left Aligned
Intention
This command can be used to re-format a string in a way that it will fit into a table, left-aligned. You can also specify the fill-character for the alignment.
Here is an example, we use the "*" as fill-character:
$$TXT=Peter
VSL.$$TXT|10|*
DBP.<$$TXT>
' Result is <Peter*****>
In the second operation mode you can omit the fill-character, in this case just a SPACE ($sp$) is used as fill-character. It looks like this:
$$TXT=Peter
VSL.$$TXT|10
DBP.<$$TXT>
' Result is <Peter >
Syntax
VSL.P1[|P2][|P3]
Parameter Explanation
P1 - Source and Target-variable.
P2 - (optional) if given then P1 specifies the number of
fill-characters to be used. If omitted, 20 is used
as default.
P3 - (optional) If specified, this is the fill-character to
be used. If omitted, SPACE (ASCII 32) is used as default.
Example
'*************************************
' VTU./VTL./VTM.- DEMO
'*************************************
'
$$TXT=Peter
VSL.$$TXT|10|-
DBP.<$$TXT>
$$TXT=Peter
VSM.$$TXT|10|#
DBP.<$$TXT>
$$TXT=Peter
VSR.$$TXT|10|+
DBP.<$$TXT>
$$NUM=125.22222
FMT.$$NUM|00.000
DBP.$$NUM
ENR.
Will give this output:
Remarks
-
Limitations:
You can not specify an Null-String (empty variable) as Fill-character. Trying to do so, will make that $sp$ will be used for the alignment.
See also:
• 1.5.2 Working with Text-Strings
• FMT. - Format Numeric Output
• VBT. - Variable-Both-sides-Trim
• VAR. - Variable Set Value/Clear
• IVS. / NVS. - If-Variable-String