ARS. - Text Document Operations

<< Click to Display Table of Contents >>

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

ARS. - Text Document Operations

 

📘 SPR Text Document Operations Manual

Welcome to the SPR Text Document Operations Manual! 🌟

This guide provides a comprehensive overview of Text Document operations in SPR, explaining what they are, how to use them, and why they are essential for managing text files. Whether you're a beginner or an experienced user, this manual will help you master Text Document operations with clear explanations and practical examples. Let’s dive in! 🚀

 

📄 Table of Contents

What are Text Document Operations?

Text Document Commands Overview

Code Examples

Illustrations

 

What are Text Document Operations? 📜

Text Document operations in SPR are used to manage and manipulate text files. These operations include loading text from a document into an array, saving text from an array to a document, getting text from an array, and setting text in an array. These operations are crucial for tasks such as data import/export, configuration management, and logging.

Text Document operations are used in various scenarios, including:

1.Loading configuration files

2.Saving user input

3.Generating reports

 

Text Document Commands Overview 🛠️

Here’s a quick overview of the most common ARS commands for Text Document operations:

 

Basic Text Document Operations

 

' Gets text from the Array.

ARS.TextGet|$$ARS|$$NOD|$$RES

 

' Loads text from a document into the Array.

ARS.TextLoad|$$ARS|"filename"

 

' Saves text from the Array to a document.

ARS.TextSave|$$ARS|"filename"

 

' Sets text in the Array.

ARS.TextSet|$$ARS|$$NOD|"text"

 

Code Examples

Here are some practical examples of using Text Document operations in SPR:

 

' Get text from the Array.

ARS.TextGet|$$ARS|1|$$RES

 

' Load text from a document into the Array.

ARS.TextLoad|$$ARS|"config.txt"

 

' Save text from the Array to a document.

ARS.TextSave|$$ARS|"output.txt"

 

' Set text in the Array.

ARS.TextSet|$$ARS|1|"New Text"

 

Illustrations

Below is an illustration of how Text Document operations work using Unicode characters:

 

Load Operation (Loading text from a file into the Array):

File: config.txt

Array: []

+----------------+

| config.txt |

+----------------+

 |

 V

+----------------+

| Array Data |

| [Line1, Line2] |

+----------------+

 

 

Save Operation (Saving text from the Array to a file):

Array: [Line1, Line2]

File: output.txt

+----------------+

| Array Data |

| [Line1, Line2] |

+----------------+

 |

 V

+----------------+

| output.txt |

+----------------+

 

 

Get Operation (Getting text from the Array):

Array: [Line1, Line2]

+----------------+

| Array Data |

| [Line1, Line2] |

+----------------+

 |

 V

+----------------+

| Line1 |

+----------------+

 

 

Set Operation (Setting text in the Array):

Array: [Line1, Line2]

+----------------+

| Array Data |

| [Line1, Line2] |

+----------------+

 |

 V

+----------------+

| New Text |

+----------------+