ARS. - Container Cloning

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > ARS. - Array's >

ARS. - Container Cloning

 

📘 SPR Container Cloning Manual

Welcome to the SPR Container Cloning Manual! 🌟

This guide provides a comprehensive overview of container cloning in SPR, explaining what it is, how to use it, and why it is a powerful tool for scripting. Whether you're a beginner or an experienced user, this manual will help you master container cloning with clear explanations and practical examples. Let’s dive in! 🚀

 

📄 Table of Contents

What is Container Cloning?

Cloning Commands Overview

Code Examples

 

What is Container Cloning? 📜

**Container Cloning** in SPR refers to the process of creating an exact copy of an existing container, such as an array or a list. This is useful for various purposes, including data backup, parallel processing, and more.

Cloning ensures that the new container is independent of the original, meaning changes to one do not affect the other.

 

Cloning Commands Overview 🛠️

Here’s a quick overview of the most common container cloning commands:

 

Cloning Commands

' Creates a copy of the container.

ARS.Clone|$$ARS|$$RES

 

' Converts the Array to a List.

ARS.ToList|$$ARS|$$RES

 

' Converts the Array to a Queue.

ARS.ToQue|$$ARS|$$RES

 

' Converts the Array to a Stack.

ARS.ToStck|$$ARS|$$RES

 

Code Examples

Example: Cloning an Array

 

' Create an Array

ARS.New|$$ARS

 

' Add items to the Array

ARS.Add|$$ARS|Apple

ARS.Add|$$ARS|Banana

ARS.Add|$$ARS|Cherry

 

' Clone the Array

ARS.Clone|$$ARS|$$CLONE

 

' Free the original Array

ARS.End|$$ARS

 

Example: Converting an Array to a List

 

' Create an Array

ARS.New|$$ARS

 

' Add items to the Array

ARS.Add|$$ARS|Apple

ARS.Add|$$ARS|Banana

ARS.Add|$$ARS|Cherry

 

' Convert the Array to a List

ARS.ToList|$$ARS|$$LIST

 

' Free the original Array

ARS.End|$$ARS