|
<< 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.TextLoad
Load a text file into the container, clearing current contents.
Intention
The ARS.TextLoad command loads the contents of a text file into the container, clearing any existing contents. Each line in the file becomes an item in the container.
Illustration:
File: C:\MyFolder\MyFile.txt
┌───────────────┐
│ Line 1 │
├───────────────┤
│ Line 2 │
├───────────────┤
│ Line 3 │
└───────────────┘
The container is loaded with the lines from the file.
Syntax
ARS.TextLoad|$$ARR|$$FILE
Parameter Explanation
P1 - $$ARR The handle of the Deque.
P2 - $$FILE The path to the text file to load.
Example
'***********************************
' ARS.TextLoad - Sample Script
'***********************************
' Create a new Deque
ARS.New|$$DEQ
' Load a text file into the Deque
ARS.TextLoad|$$DEQ|C:\MyFolder\MyFile.txt
' Display the first line
ARS.PeekFirst|$$DEQ|$$RES
DBP.The first line is: $$RES
' End the script
ENR.
Remarks
-
Limitations:
- The file must exist and be accessible.
See also:
• ARS.New