|
<< 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.ToQue
Converts an array to a queue for use with the QUE commands.
Intention
The ARS.ToQue command converts an array to a queue, allowing it to be used with the QUE commands. This is useful for integrating array operations with queue operations.
Illustration:
📦 Array: [1, 2, 3, 4, 5]
🔑 Handle: $$ARR
🔄 Converted to Queue: [1, 2, 3, 4, 5]
🔑 New Handle: $$QUE
Syntax
ARS.ToQue|$$ARR[|$$QUE]
Parameter Explanation
P1 - $$ARR - (Variable)
The handle of the array to convert to a queue.
P2 - $$QUE (optional) - (Variable)
The variable to store the handle of the new queue. If omitted, the handle is placed on the Top of Stack (TOS).
Example
'***********************************
' ARS.ToQue - 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.ToQue|$$ARR|$$QUE
DBP.New Queue: [1, 2, 3, 4, 5]
QUE.End|$$QUE
'
'***********************************
' ARS.ToQue - 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.ToQue|$$ARR
DBP.New Queue: [100, 200, 300, 400, 500]
QUE.End|$$QUE
'
'***********************************
' ARS.ToQue - 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.ToQue|$$ARR|$$QUE
DBP.New Queue: [1.1, 2.2, 3.3, 4.4, 5.5]
QUE.End|$$QUE
'
Remarks
-
Limitations:
-
See also:
•