ARS. - Array Operations

<< Click to Display Table of Contents >>

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

ARS. - Array Operations

 

📘 SPR Array Commands Manual

Welcome to the SPR Array Commands Manual! 🌟

This guide provides a comprehensive overview of Arrays 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 Arrays with clear explanations and practical examples. Let’s dive in! 🚀

 

📄 Table of Contents

What is an Array?

Array Commands Overview

Code Examples

 

What is an Array? 📜

An Array in SPR is a dynamic, ordered container that can store multiple pieces of data, such as numbers, text, or more complex objects. Think of it as a flexible list or a sequence of elements that you can manipulate in various ways.

Arrays are dynamic, meaning they can grow or shrink as you add or remove items. They can hold different types of data, including:

1.Strings (e.g., "Hello")

2.Integers (e.g., 123) - 64-bit numbers with a range of -9.22x10^18 to 9.22x10^18

3.Floats (e.g., 3.14) - Floating-point numbers with 18 digits of precision

 

Array Commands Overview 🛠️

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

 

Container Management

 

' Creates a new Array.

ARS.New|$$ARS[|Type]

 

' Frees the Array from memory.

ARS.End|$$ARS

 

' Removes all items from the Array.

ARS.Clear|$$ARS

 

' Returns the number of items in the Array.

ARS.Count|$$ARS|$$RES

 

Adding and Removing Items

 

' Adds an item to the end of the Array.

ARS.Add|$$ARS|Value

 

' Inserts an item at the beginning of the Array.

ARS.Insert|$$ARS|Value

 

' Removes the item at the specified node.

ARS.Delete|$$ARS|$$NOD

 

Accessing Items

' Retrieves the value of a specific node.

ARS.Get|$$ARS|$$NOD|$$RES

' Updates the value of a specific node.

ARS.Set|$$ARS|$$NOD|Value

 

Advanced Operations

' Creates a copy of the Array.

ARS.Clone|$$ARS|$$RES

 

' Reverses the order of items in the Array.

ARS.Reverse|$$ARS

 

' Sorts the items in the Array.

ARS.Sort|$$ARS

 

' Sorts the Array and removes duplicates.

ARS.UniqueSort|$$ARS

 

' Validates the Array.

ARS.Validate|$$ARS

 


 

Speed-Dump

 

017 0000000000000081 0001 VAR.$$MSG=(0) Teste ARS.New

018 0000000000000193 0001 ARS.New|$$ARR

019 0000000000000152 0001 JIZ.$$ARR|Lab_failed

020 0000000000000134 0001 ARS.Validate|$$ARR|$$RES

021 0000000000000115 0001 JIZ.$$RES|Lab_failed

022 0000000000000085 0001 ARS.End|$$ARR

023 0000000000000004 0001

024 0000000000000049 0001 VAR.$$MSG=(2) Teste ARS.Validate mit ung³ltigem Handle

025 0000000000000043 0001 VAR.$$ARR=123434

026 0000000000000143 0001 ARS.Validate|$$ARR|$$RES

027 0000000000000114 0001 JNZ.$$RES|Lab_failed

028 0000000000000004 0001

029 0000000000000045 0001 VAR.$$MSG=(3) Teste ARS.Add/Append mir "s" und Clear

030 0000000000000043 0001 VAR.$$NUM=5

031 0000000000000117 0001 ARS.New|$$ARR|s

032 0000000000000106 0001 JIZ.$$ARR|Lab_failed

033 0000000000000155 0006 FOR.$$RES|1|$$NUM

034 0000000000000068 0005 VAR.$$LAA=Text_$$RES

035 0000000000000068 0005 VAR.$$LAB=X$$RESX

036 0000000000000101 0005 ARS.Add|$$ARR|$$LAA

037 0000000000000104 0005 ARS.Insert|$$ARR|1|$$LAB

038 0000000000000012 0006 NEX.

039 0000000000000110 0001 ARS.Count|$$ARR|$$RES

040 0000000000000357 0001 JIV.$$RES!($$NUM*2)|Lab_failed

041 0000000000000091 0001 ARS.Clear|$$ARR

042 0000000000000109 0001 ARS.Count|$$ARR|$$RES

043 0000000000000108 0001 JNZ.$$RES|Lab_failed

044 0000000000000074 0001 ARS.End|$$ARR

045 0000000000000004 0001

046 0000000000000046 0001 VAR.$$MSG=(4) Teste ARS.Add/Append mir "i" und Clear

047 0000000000000042 0001 VAR.$$NUM=5

048 0000000000000115 0001 ARS.New|$$ARR|i

049 0000000000000110 0001 JIZ.$$ARR|Lab_failed

050 0000000000000156 0006 FOR.$$RES|1|$$NUM

051 0000000000000114 0005 ARS.Add|$$ARR|$$RES

052 0000000000000217 0005 CAL.$$LAC=$$NUM-$$RES

053 0000000000000129 0005 ARS.Insert|$$ARR|1|$$LAC

054 0000000000000011 0006 NEX.

055 0000000000000113 0001 ARS.Count|$$ARR|$$RES

056 0000000000000302 0001 JIV.$$RES!($$NUM*2)|Lab_failed

057 0000000000000072 0001 ARS.Clear|$$ARR

058 0000000000000106 0001 ARS.Count|$$ARR|$$RES

059 0000000000000104 0001 JNZ.$$RES|Lab_failed

060 0000000000000072 0001 ARS.End|$$ARR

061 0000000000000005 0001

062 0000000000000046 0001 VAR.$$MSG=(5) Teste ARS.Add/Append mir "f" und Clear

063 0000000000000041 0001 VAR.$$NUM=5

064 0000000000000114 0001 ARS.New|$$ARR|f

065 0000000000000107 0001 JIZ.$$ARR|Lab_failed

066 0000000000000155 0006 FOR.$$RES|1|$$NUM

067 0000000000000122 0005 ARS.Add|$$ARR|$$RES

068 0000000000000333 0005 CAL.$$LAC=$$NUM-$$RES/1.33

069 0000000000000139 0005 ARS.Insert|$$ARR|1|$$LAC

070 0000000000000011 0006 NEX.

071 0000000000000113 0001 ARS.Count|$$ARR|$$RES

072 0000000000000300 0001 JIV.$$RES!($$NUM*2)|Lab_failed

073 0000000000000073 0001 ARS.Clear|$$ARR

074 0000000000000107 0001 ARS.Count|$$ARR|$$RES

075 0000000000000103 0001 JNZ.$$RES|Lab_failed

076 0000000000000071 0001 ARS.End|$$ARR

077 0000000000000005 0001

078 0000000000000045 0001 VAR.$$MSG=(6) Teste ARS.Insert

079 0000000000000043 0001 VAR.$$LAA=Hallo

080 0000000000000040 0001 VAR.$$NUM=5

081 0000000000000113 0001 ARS.New|$$ARR|s

082 0000000000000108 0001 JIZ.$$ARR|Lab_failed

083 0000000000000181 0001 ARS.Insert|$$ARR|$$NUM|$$LAA

084 0000000000000114 0001 ARS.Count|$$ARR|$$LAD

085 0000000000000137 0001 JIV.$$LAD!6|Lab_failed

086 0000000000000004 0001

087 0000000000000004 0001

088 0000000000000042 0001 VAR.$$MSG=(7) Teste ARS.Get

089 0000000000000041 0001 VAR.$$LAA=Hallo

090 0000000000000112 0001 ARS.New|$$ARR|s

091 0000000000000104 0001 JIZ.$$ARR|Lab_failed

092 0000000000000097 0001 ARS.Add|$$ARR|$$LAA

093 0000000000000108 0001 ARS.Count|$$ARR|$$LAD

094 0000000000000133 0001 JIV.$$LAD!1|Lab_failed

095 0000000000000124 0001 ARS.Get|$$ARR|1|$$LAB

096 0000000000000196 0001 JIV.$$LAB!$$LAA|Lab_failed

097 0000000000000073 0001 ARS.End|$$ARR

098 0000000000000004 0001

099 0000000000000043 0001 VAR.$$MSG=(8) Teste ARS.Get

100 0000000000000040 0001 VAR.$$NUM=5

101 0000000000000109 0001 ARS.New|$$ARR|s

102 0000000000000152 0006 FOR.$$RES|1|$$NUM

103 0000000000000068 0005 VAR.$$LAA=Text_$$RES

104 0000000000000102 0005 ARS.Add|$$ARR|$$LAA

105 0000000000000011 0006 NEX.

106 0000000000000156 0006 FOR.$$RES|1|$$NUM

107 0000000000000069 0005 VAR.$$LAA=Text_$$RES

108 0000000000000130 0005 ARS.Get|$$ARR|$$RES|$$LAB

109 0000000000000188 0005 JIV.$$LAB!$$LAA|Lab_failed

110 0000000000000011 0006 NEX.

111 0000000000000082 0001 ARS.End|$$ARR

112 0000000000000005 0001

113 0000000000000043 0001 VAR.$$MSG=(9) Teste ARS.Get

114 0000000000000041 0001 VAR.$$NUM=5

115 0000000000000114 0001 ARS.New|$$ARR|s

116 0000000000000153 0006 FOR.$$RES|1|$$NUM

117 0000000000000068 0005 VAR.$$LAA=Text_$$RES

118 0000000000000097 0005 ARS.Add|$$ARR|$$LAA

119 0000000000000011 0006 NEX.

120 0000000000000043 0001 VAR.$$LAC=1

121 0000000000000166 0006 FOR.$$RES|$$NUM|1|-1

122 0000000000000066 0005 VAR.$$LAA=Text_$$LAC

123 0000000000000104 0005 ARS.Set|$$ARR|$$RES|$$LAA

124 0000000000000126 0005 ARS.Get|$$ARR|$$RES|$$LAD

125 0000000000000189 0005 JIV.$$LAA!$$LAD|Lab_failed

126 0000000000000086 0005 VIC.$$LAC

127 0000000000000010 0006 NEX.

128 0000000000000004 0001

129 0000000000000043 0001 VAR.$$MSG=(10) Teste ARS.Del

130 0000000000000081 0001 ARS.Del|$$ARR|1

131 0000000000000071 0001 ARS.Del|$$ARR|3

132 0000000000000040 0001 VAR.$$RES=4

133 0000000000000065 0001 VAR.$$LAA=Text_$$RES

134 0000000000000121 0001 ARS.Get|$$ARR|1|$$LAB

135 0000000000000190 0001 JIV.$$LAB!$$LAB|Lab_failed

136 0000000000000004 0001

137 0000000000000039 0001 VAR.$$RES=3

138 0000000000000064 0001 VAR.$$LAA=Text_$$RES

139 0000000000000137 0001 ARS.Get|$$ARR|2|$$LAB

140 0000000000000188 0001 JIV.$$LAB!$$LAB|Lab_failed

141 0000000000000004 0001

142 0000000000000039 0001 VAR.$$RES=1

143 0000000000000068 0001 VAR.$$LAA=Text_$$RES

144 0000000000000124 0001 ARS.Get|$$ARR|3|$$LAB

145 0000000000000187 0001 JIV.$$LAB!$$LAB|Lab_failed

146 0000000000000004 0001

147 0000000000000116 0001 ARS.Count|$$ARR|$$LAD

148 0000000000000177 0001 JIV.$$LAD!3|Lab_failed

149 0000000000000078 0001 ARS.End|$$ARR

150 0000000000000004 0001

151 0000000000000042 0001 VAR.$$MSG=(11) Teste ARS.Get

152 0000000000000040 0001 VAR.$$NUM=5

153 0000000000000116 0001 ARS.New|$$ARR|s

154 0000000000000004 0001

155 0000000000000004 0001

156 0000000000000129 0001 VAR.$$MSG=(12) Teste ARS.ToList

157 0000000000000042 0001 VAR.$$NUM=5

158 0000000000000118 0001 ARS.New|$$ARR|s

159 0000000000000108 0001 JIZ.$$ARR|Lab_failed

160 0000000000000153 0006 FOR.$$RES|1|$$NUM

161 0000000000000069 0005 VAR.$$LAA=Text_$$RES

162 0000000000000098 0005 ARS.Add|$$ARR|$$LAA

163 0000000000000010 0006 NEX.

164 0000000000000111 0001 ARS.Count|$$ARR|$$NUM

165 0000000000000132 0001 JIV.$$NUM!5|Lab_failed

166 0000000000000191 0001 ARS.ToList|$$ARR|$$LST

167 0000000000000151 0001 LST.Count|$$LST|$$NUM

168 0000000000000129 0001 JIV.$$NUM!5|Lab_failed

169 0000000000000097 0001 LST.End All

170 0000000000000107 0001 ARS.End All

171 0000000000000004 0001

172 0000000000000044 0001 VAR.$$MSG=(13) Teste ARS.ToQue

173 0000000000000040 0001 VAR.$$NUM=5

174 0000000000000114 0001 ARS.New|$$ARR|s

175 0000000000000105 0001 JIZ.$$ARR|Lab_failed

176 0000000000000166 0006 FOR.$$RES|1|$$NUM

177 0000000000000073 0005 VAR.$$LAA=Text_$$RES

178 0000000000000113 0005 ARS.Add|$$ARR|$$LAA

179 0000000000000009 0006 NEX.

180 0000000000000119 0001 ARS.Count|$$ARR|$$NUM

181 0000000000000143 0001 JIV.$$NUM!5|Lab_failed

182 0000000000000195 0001 ARS.ToQue|$$ARR|$$QUE

183 0000000000000151 0001 QUE.Count|$$QUE|$$NUM

184 0000000000000138 0001 JIV.$$NUM!5|Lab_failed

185 0000000000000102 0001 QUE.End All

186 0000000000000091 0001 ARS.End All

187 0000000000000004 0001

188 0000000000000044 0001 VAR.$$MSG=(14) Teste ARS.ToStck

189 0000000000000044 0001 VAR.$$NUM=5

190 0000000000000120 0001 ARS.New|$$ARR|s

191 0000000000000114 0001 JIZ.$$ARR|Lab_failed

192 0000000000000165 0006 FOR.$$RES|1|$$NUM

193 0000000000000074 0005 VAR.$$LAA=Text_$$RES

194 0000000000000106 0005 ARS.Add|$$ARR|$$LAA

195 0000000000000011 0006 NEX.

196 0000000000000119 0001 ARS.Count|$$ARR|$$NUM

197 0000000000000138 0001 JIV.$$NUM!5|Lab_failed

198 0000000000000195 0001 ARS.To Stack|$$ARR|$$STK

199 0000000000000149 0001 STK.Count|$$STK|$$NUM

200 0000000000000136 0001 JIV.$$NUM!5|Lab_failed

201 0000000000000004 0001

202 0000000000000077 0001 STK.End All

203 0000000000000085 0001 ARS.End All

204 0000000000000005 0001

205 0000000000000000 0001 DMP.Speed

206 0000000000000000 0000 MBX.!