Smart Package Robot 's List Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > LST. - List Arrays > String-Builder >

 Smart Package Robot 's List Commands

LST.BuildStr - Build String from Container Segments

Previous Top Next


MiniRobotLanguage (MRL)

 

LST.BuildStr

Concatenate all segments in a container into a single string

 

 

Intention

 

The LST.BuildStr command concatenates all segments (elements) of a container into a single string. This is particularly useful when you have a list of strings or segments that you want to combine into one cohesive string.

The command takes two parameters: the handle of the container and the variable where the resulting string will be stored. If the variable is omitted, the result will be placed on the top of the stack (TOS).

 

 

Syntax

 

LST.BuildStr|P1|P2

 

Parameter Explanation

 

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

P2 - (Optional) The variable where the resulting concatenated string will be stored. If omitted, the result will be placed on the top of the stack (TOS).

 

 

Example

 

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

' LST.BuildStr Sample

'***********************************
' Create a new list and add some elements

LST.New|$$LST

LST.Add|$$LST|Hello

LST.Add|$$LST|World

LST.Add|$$LST|!

 

' Build a string from the list segments

LST.BuildStr|$$LST|$$RES

DBP.Resulting string: $$RES

 

' End the script

ENR.

 

 

Remarks

 

-

 

 

Limitations:

- All elements in the container must be strings or convertible to strings.

 

See also:

 

LST.Add - Add Element to List

LST.New - Create a New List

LST.Get - Get Element from List