|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > ARS. - Array's > !ARS. - Array Operations > ARS. - Array Operations |
MiniRobotLanguage (MRL)
ARS.New
Creates a new array and returns its handle.
Intention
The ARS.New command creates a new array container and returns a handle to it. The array can store values of a specified data type (String, Integer, or Floating-Point). If no data type is specified, the default is String.
Illustration:
📦 New Array: []
🔑 Handle stored in $$ARS
🔢 Data type: String (default)
Syntax
ARS.New|P1[|P2]
Parameter Explanation
P1 - (Variable)
This variable will store the handle of the newly created array.
P2 - (Optional, String)
Specifies the data type of the array. Possible values:
• "s" - Text/Strings any Data incl. Binary Data (default)
• "i" - 64-bit Integer number with a range of -9.22x10^18 to 9.22x10^18 ( -2^63 to 2^63 -1)
• "f" - floating point number with a range of approximately +/- 3.4*10^-4932 to 1.2*10^4932, and offer 18 digits of precision
Example
'***********************************
' ARS.New - Sample 1
'***********************************
ARS.New|$$ARS
DBP.New String Array created with handle: $$ARS
ARR.End|$$ARS
'
'***********************************
' ARS.New - Sample 2
'***********************************
ARS.New|$$ARS|i
DBP.New Integer array created with handle: $$ARS
ARS.Add|$$ARS|100
ARS.Add|$$ARS|200
ARS.Add|$$ARS|300
DBP.New Array contents: 100, 200, 300
ARR.End|$$ARS
'
'***********************************
' ARS.New - Sample 3
'***********************************
ARS.New|$$ARS|f
DBP.New Floating-Point array created with handle: $$ARS
ARS.Add|$$ARS|1.1
ARS.Add|$$ARS|2.2
ARS.Add|$$ARS|3.3
DBP.New Array contents: 1.1, 2.2, 3.3
ARR.End|$$ARS
'
Remarks
-
Limitations:
-
See also:
•