|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > ARS. - Array's > !ARS. - Container Cloning > ARS. - Container Cloning |
MiniRobotLanguage (MRL)
ARS.ToList
Returns a handle of a List-Container just as if you had called "LST.New" with the content of the Array.
Intention
The ARS.ToList command converts an array into a list container. This is useful for converting the array into a list format for further processing.
Illustration:
📦 Array: [1, 2, 3, 4, 5]
🔑 Handle: $$ARR
🔄 Converted to List: [1, 2, 3, 4, 5]
🔑 New Handle: $$LST
Syntax
ARS.To List|$$ARR[|$$LST]
Parameter Explanation
P1 - $$ARR - (Variable)
The handle of the array to convert into a list.
P2 - $$LST (optional) - (Variable)
The variable to store the handle of the new list. If omitted, the handle is placed on the Top of Stack (TOS).
Example
'***********************************
' ARS.ToList - Sample 1
'***********************************
ARS.New|$$ARR
ARS.Add|$$ARR|1
ARS.Add|$$ARR|2
ARS.Add|$$ARR|3
ARS.Add|$$ARR|4
ARS.Add|$$ARR|5
ARS.ToList|$$ARR|$$LST
DBP.New List: [1, 2, 3, 4, 5]
LST.End|$$LST
'
'***********************************
' ARS.ToList - Sample 2
'***********************************
ARS.New|$$ARR|i
ARS.Add|$$ARR|100
ARS.Add|$$ARR|200
ARS.Add|$$ARR|300
ARS.Add|$$ARR|400
ARS.Add|$$ARR|500
ARS.ToList|$$ARR
DBP.New List: [100, 200, 300, 400, 500]
LST.End|$$LST
'
'***********************************
' ARS.ToList - Sample 3
'***********************************
ARS.New|$$ARR|f
ARS.Add|$$ARR|1.1
ARS.Add|$$ARR|2.2
ARS.Add|$$ARR|3.3
ARS.Add|$$ARR|4.4
ARS.Add|$$ARR|5.5
ARS.ToList|$$ARR|$$LST
DBP.New List: [1.1, 2.2, 3.3, 4.4, 5.5]
LST.End|$$LST
'
Remarks
-
Limitations:
-
See also:
•