|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > Store/Restore-Operations > LST. - Management |
MiniRobotLanguage (MRL)
LST.To Arr
Copy a list to a new array.
Intention
The LST.To Arr command copies a list to a new array.
This is useful when you need to work with the list elements in an array format.
The elements will be copied to a new array.
The original list handle will still be valid and all elements will be in the list as before.
Illustration
Before LST.To Arr operation:
List: [1, 2, 3]
After LST.To Arr operation:
Array: [1, 2, 3]
The elements are copied to a new array. The original list remains unchanged.
Syntax
LST.To Arr|P1|P2
Parameter Explanation
P1 - (Variable)
The handle of the list to convert.
P2 - (optional, Variable)
The variable to store the handle of the new array.
Example
'***********************************
' LST.To Arr - Sample
'***********************************
LST.New|$$LST
LST.Add|$$LST|1
LST.Add|$$LST|2
LST.Add|$$LST|3
LST.To Arr|$$LST|$$ARR
ARR.Count|$$ARR|$$RES
DBP.Array has $$RES items.
ARR.End|$$ARR
LST.End|$$LST
ENR.
Remarks
-
Limitations:
-
See also:
•