|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > QUE. - Queue > QUE. - Management |
MiniRobotLanguage (MRL)
QUE.-Management Commands
These commands let you manage the queue's
Overview
The QUE.-Management commands provide functionality for creating, managing, and manipulating queues.
A queue is a data structure that follows the First-In-First-Out (FIFO) principle, meaning the first element added to the queue is the first one to be removed. Queues are useful for managing ordered data, such as task scheduling, buffering, or processing sequences.
A handle is a unique identifier that references a specific queue. It is used to interact with the queue in subsequent commands. Handles are automatically generated when a queue is created and become invalid once the queue is deallocated.
A queue is a linear data structure that stores elements in a specific order. It follows the First-In-First-Out (FIFO) principle, meaning the first element added to the queue is the first one to be removed. Queues are commonly used for:
1.Task scheduling (e.g., processing tasks in the order they are received).
2.Buffering data (e.g., holding data temporarily before processing).
3.Managing sequences of operations or events.
A handle is a unique identifier that references a specific queue. It is generated when a queue is created using QUE.New and is used to interact with the queue in subsequent commands. Handles are essential for managing multiple queues simultaneously. Once a queue is deallocated using QUE.End or QUE.EndAll, its handle becomes invalid.
Example
'***********************************
' QUE.-Management Sample
'***********************************
QUE.New|$$QUE
DBP.New queue created with this Handle: $$QUE
QUE.Push|$$QUE|42
QUE.Push|$$QUE|"Hello"
QUE.Count|$$QUE|$$COUNT
DBP.Number of elements in queue: $$COUNT
QUE.Peek|$$QUE|$$VAL
DBP.First value in queue: $$VAL
QUE.Pop|$$QUE|$$VAL
DBP.Value popped from queue: $$VAL
QUE.Clear|$$QUE
DBP.Queue cleared.
QUE.End|$$QUE
DBP.Queue deallocated.
ENR.
Remarks
-
Limitations:
-
See also:
• ! Smart Package Robot 's Parallel Robot Operations