|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > Queue-Operations > Smart Package Robot 's Queue Commands |
MiniRobotLanguage (MRL)
LST.QuePush
Add a Value to the End of the Queue
Intention
The LST.QuePush command is used to add a value to the end of a queue in a specified list container. This is useful for managing data in a First-In-First-Out (FIFO) manner, where the first value added to the queue is the first one to be retrieved.
The queue is a fundamental data structure that allows you to store and retrieve values in a specific order. The LST.QuePush command adds a value to the end of the queue, while the LST.QuePop command retrieves and removes the value from the front of the queue.
Syntax
LST.QuePush|P1|P2
Parameter Explanation
P1 - The handle of the list container. This is a numeric value or a variable that contains the handle of the list.
P2 - The value to be added to the end of the queue. This can be a numeric value, a string, or a variable containing the value.
Example
'***********************************
' LST.QuePush Sample Script
'***********************************
' Create a new list container
LST.New|$$LST
' Add values to the queue
LST.QuePush|$$LST|10
LST.QuePush|$$LST|20
LST.QuePush|$$LST|30
' Pop values from the queue
LST.QuePop|$$LST|$$VAL1
LST.QuePop|$$LST|$$VAL2
LST.QuePop|$$LST|$$VAL3
' Display the popped values
DBP.$$VAL1
DBP.$$VAL2
DBP.$$VAL3
' End the script
ENR.
Remarks
-
Limitations:
- The queue size is limited by the available memory.
See also:
• LST.QuePop - Pop a Value from the Queue
• LST.New - Create a New List Container
• LST.End - End a List Container