|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > ARS. - Array's > !ARS. - Text Document Operations > ARS. - Text Document Operations |
MiniRobotLanguage (MRL)
ARS.TextSet
Replace the container's contents with a text document (each line = item in container, removing CrLf).
Intention
The ARS.TextSet command replaces the container's contents with the lines from a text document. Each line in the text document becomes an item in the container, and any carriage return or line feed (CrLf) characters are removed.
Illustration:
Text Document:
┌───────────────┐
│ Line 1 │
├───────────────┤
│ Line 2 │
├───────────────┤
│ Line 3 │
└───────────────┘
The container is replaced with the lines from the text document.
Syntax
ARS.TextSet|$$ARR|$$STRING
Parameter Explanation
P1 - $$ARR The handle of the Deque.
P2 - $$STRING The text document to load into the container. Each line in the document becomes an item in the container.
Example
'***********************************
' ARS.TextSet - Sample Script
'***********************************
' Create a new Deque
ARS.New|$$DEQ
' Define a text document
$$TXT=Line1$$CRLF$$Line2$$CRLF$$Line3
' Replace the container's contents with the text document
ARS.TextSet|$$DEQ|$$TXT
' Display the first item
ARS.PeekFirst|$$DEQ|$$RES
DBP.The first item is: $$RES
' End the script
ENR.
Remarks
-
Limitations:
- The text document must not be empty when using this command.
See also:
• ARS.New