<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !STR.- String Command > String Operations |
MiniRobotLanguage (MRL)
STR.REVERSE
String commands
Intention
REVERSE - Mode: This will reverse all bytes in a String. The last byte will be the first byte.
The command itself looks like this:
STR.REVERSE|$$SRC
And here is a small example:
: $$TXT=ABC
: $$NUM=5
STR.CLONE|$$SRC|$$NUM|$$TXT
MBX.$$SRC
STR.REVERSE|$$SRC
MBX.$$SRC
ENR.
Which will bring up a Message-Box before the reversing:
and a Message-Box after the string was reversed:
Looking at these clearly shows what we have been doing here.
To Replace bytes in a String, use the RPL. - RePLace in String command.
To extract a part out of a String, use the GSS. - GetSplitString command.
If your String is a delimited String (like a .csv-file), use:
• SBD. - String between Delimiter
• SBM. - String between Delimiter-Multiple
Syntax
STR.REVERSE|P1
Parameter Explanation
P1 - source and destination variable
Example
'*************************************
' STR.REVERSE
'*************************************
: $$TXT=ABC
: $$NUM=5
STR.CLONE|$$SRC|$$NUM|$$TXT
MBX.$$SRC
STR.REVERSE|$$SRC
MBX.$$SRC
ENR.
Remarks
Variables inside the source P1 are only resolved once. Therefore it can be safely used for binary data. Specialfolders and systemvariables etc. are not resolved, to avoid unwanted changes in binary data.
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