|
<< 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.Validate
Checks if the handle is valid for the specified array.
Intention
The ARS.Validate command checks if the handle is valid for the specified array. This is useful for verifying the integrity of the array handle before performing operations on the array.
Illustration:
📦 Array: [1, 2, 3, 4, 5]
🔑 Handle: $$ARR
🔍 Validation: 1
🔑 Result stored in $$RES
Syntax
ARS.Validate|$$ARR[|$$RES]
Parameter Explanation
P1 - $$ARR - (Variable)
The handle of the array to validate.
P2 - $$RES (optional) - (Variable)
The variable to store the result of the validation (1/0). If omitted, the result is placed on the Top of Stack (TOS).
Example
'***********************************
' ARS.Validate - Sample 1
'***********************************
ARS.New|$$ARR
ARS.Add|$$ARR|1
ARS.Add|$$ARR|2
ARS.Add|$$ARR|3
ARS.Validate|$$ARR|$$RES
DBP.New Validation result: $$RES
ARR.End|$$ARR
'
'***********************************
' ARS.Validate - Sample 2
'***********************************
ARS.New|$$ARR|i
ARS.Add|$$ARR|100
ARS.Add|$$ARR|200
ARS.Add|$$ARR|300
ARS.Validate|$$ARR
DBP.New Validation result on TOS
ARR.End|$$ARR
'
'***********************************
' ARS.Validate - Sample 3
'***********************************
ARS.New|$$ARR|f
ARS.Add|$$ARR|1.1
ARS.Add|$$ARR|2.2
ARS.Add|$$ARR|3.3
ARS.Validate|$$ARR|$$RES
DBP.New Validation result: $$RES
ARR.End|$$ARR
'
Remarks
-
Limitations:
-
See also:
•