Smart Package Robot 's List Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > LST. - List Arrays > Store/Restore-Operations >

 Smart Package Robot 's List Commands

LST.Import - Import a Delimited String into a List Container

Previous Top Next


MiniRobotLanguage (MRL)

 

LST.Import

Import a Delimited String into a List Container

 

 

Intention

 

The LST.Import command is used to import a delimited string into a list container. This is useful when you have a string of values separated by a delimiter (e.g., a comma or semicolon) and want to store them in a list for further processing.

The default delimiter is a semicolon (;), but you can specify a custom delimiter if needed.

 

 

Syntax

 

LST.Import|P1|P2[|P3]

 

 

Parameter Explanation

 

P1 - The handle of the list container. This is a numeric value or a variable that contains the handle of the list.

P2 - The delimited string to import into the list. This can be a string or a variable containing the string.

P3 - (Optional) The delimiter used to separate values in the string. If omitted, the default delimiter ; is used.

 

 

Example

 

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

' LST.Import Sample Script

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

' Create a new list container

LST.New|$$LST

' Define a delimited string

$$STR=Apple;Banana;Cherry;Date

' Import the string into the list

LST.Import|$$LST|$$STR

' Display the imported values

LST.Get|$$LST|1|$$VAL1

LST.Get|$$LST|2|$$VAL2

LST.Get|$$LST|3|$$VAL3

LST.Get|$$LST|4|$$VAL4

DBP.Imported values: $$VAL1, $$VAL2, $$VAL3, $$VAL4

' End the script

ENR.

 

 

Remarks

 

-

 

 

Limitations:

- The delimiter must be a single character. Multi-character delimiters are not supported.

 

See also:

 

LST.New - Create a New List Container

LST.Add - Add a Value to the List

LST.Get - Retrieve a Value from the List