|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > Text-Document Operations > Smart Package Robot 's List Commands |
MiniRobotLanguage (MRL)
LST.TextSave
Save the contents of a container to a text file
Intention
The LST.TextSave command saves the contents of a container to a text file. Each element in the container is written as a separate line in the file. This is useful for exporting data from a container to a text file for further processing or storage.
The command takes two parameters: the handle of the container and the file path where the contents should be saved.
Syntax
LST.TextSave|P1|P2
Parameter Explanation
P1 - The handle of the container. This is typically a variable that contains the handle of the container.
P2 - The file path where the container contents should be saved.
Example
'***********************************
' LST.TextSave Sample
'***********************************
' Create a new list and add some elements
LST.New|$$LST
LST.Add|$$LST|Hello
LST.Add|$$LST|World
LST.Add|$$LST|!
' Save the list to a text file
LST.TextSave|$$LST|C:\Temp\MyTextFile.txt
' End the script
ENR.
Remarks
-
Limitations:
- The file path must be valid and writable.
- All elements in the container must be strings or convertible to strings.
See also:
• LST.Add - Add Element to List
• LST.TextLoad - Load Text File into Container