ARS. - String Builder Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > ARS. - Array's > !ARS. - String Builder Operations >

ARS. - String Builder Operations

ARS.BuildStr

Previous Top Next


MiniRobotLanguage (MRL)

 

ARS.BuildStr

Build a string from the elements of an array, with different delimiters based on data type.

 

 

Intention

 

The ARS.BuildStr command constructs a string from the elements of an array. The delimiter used depends on the data type of the elements:

- For strings, elements are concatenated directly without any delimiter.

- For integers, a comma (,) is used as the delimiter.

- For floating-point numbers, a semicolon (;) is used as the delimiter.

 

Illustration:

Array Elements:

┌───────────────┐

│ String1       │

│ String2       │

└───────────────┘

Result: "String1String2"

 

Syntax

 

ARS.BuildStr|$$ARR[|$$RES]

 

Parameter Explanation

 

P1 - $$ARR The handle of the array.

P2 - $$RES (Optional) The variable to store the resulting string.

 

 

Example

 

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

' ARS.BuildStr - Sample Script

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

' Create a new array

ARS.New|$$ARR|s

' Add elements to the array

ARS.Add|$$ARR|Hello

ARS.Add|$$ARR|World

' Build the string

ARS.BuildStr|$$ARR|$$RES

DBP.The resulting string is: $$RES

' End the script

ENR.

 

Remarks

 

-

 

Limitations:

- The array must not be empty when using this command.

 

See also:

 

ARS.New

ARS.Add