Smart Package Robot 's List Commands

<< 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

LST.TextSet - Set Container Contents from Text Document

Previous Top Next


MiniRobotLanguage (MRL)

 

LST.TextSet

Set the contents of a container from a text document

 

 

Intention

 

The LST.TextSet command sets the contents of a container from a text document. Each line in the text document becomes a separate element in the container. This is useful for initializing a container with data from a text file or string.

The command takes two parameters: the handle of the container and the text document (or string) to load into the container.

 

 

Syntax

 

LST.TextSet|P1|P2

 

Parameter Explanation

 

P1 - The handle of the container. This is typically a variable that contains the handle of the container.

P2 - The text document (or string) to load into the container. Each line in the document becomes a separate element.

 

 

Example

 

'***********************************

' LST.TextSet Sample

'***********************************
' Create a new list

LST.New|$$LST

 

' Set the contents of the list from a text document

$$TXT=Hello$crlfWorld$crlf!

LST.TextSet|$$LST|$$TXT

 

' Display the number of items in the list

LST.Count|$$LST|$$CNT

DBP.Number of items: $$CNT

 

' End the script

ENR.

 

 

Remarks

 

-

 

 

Limitations:

- The text document must be a valid string or file path.

- Each line in the document becomes a separate element in the container.

 

See also:

 

LST.New - Create a New List

LST.TextLoad - Load Text File into Container

LST.Count - Get Number of Items in Container