|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > ARS. - Array's > ARS. - Queue Operations |
📘 SPR Queue Operations Manual
This guide provides a comprehensive overview of Queues in SPR, explaining what they are, how to use them, and why they are a powerful tool for scripting. Whether you're a beginner or an experienced user, this manual will help you master Queues with clear explanations and practical examples. Let’s dive in! 🚀
•What is a Queue?
•Queue Commands Overview
•Code Examples
A Queue in SPR is a First-In-First-Out (FIFO) data structure that allows you to store and retrieve elements in a specific order. Think of it as a line of people waiting for a service; the first person to join the line is the first to be served.
Queues are particularly useful for managing tasks, events, or any scenario where order matters. They can hold different types of data, including:
1.Strings (e.g., "Task1")
2.Integers (e.g., 123)
3.Floats (e.g., 3.14)
Here’s a quick overview of the most common ARS commands for Queue operations:
' Peeks at the first element of the Queue without removing it.
ARS.QuePeek|$$QUEUE|$$RES
' Removes and returns the first element of the Queue.
ARS.QuePop|$$QUEUE|$$RES
' Adds an element to the end of the Queue.
ARS.QuePush|$$QUEUE|Value
' Converts the Queue to an Array.
ARS.ToArray|$$QUEUE|$$RES
' Validates the Queue structure.
ARS.Validate|$$QUEUE