|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > STK. - Stack > STK.-Management > Stack Management Commands |
MiniRobotLanguage (MRL)
STK.Validate
Check if the handle is valid for this container
Intention
The STK.Validate command is used to check if a given stack handle is valid. A stack handle is considered valid if it refers to an existing stack that has not been ended or cleared. This command is particularly useful when working with multiple stacks or when you need to ensure that a stack is still available before performing operations on it.
The command returns 1 if the handle is valid and 0 if it is not. If the result variable is omitted, the result is placed on the Top of Stack (TOS).
Syntax
STK.Validate|P1[|P2]
Parameter Explanation
P1 - The stack handle to validate. This is typically a variable that contains the handle of the stack.
P2 - (Optional) The variable to store the result. If omitted, the result is placed on the Top of Stack (TOS).
Example
'***********************************
' STK.Validate - Sample Script
'***********************************
' Create a new stack
STK.New|$$STK
' Validate the stack handle
STK.Validate|$$STK|$$RET
DBP. Stack handle is valid: $$RET
' End the stack
STK.End|$$STK
' Validate the stack handle again
STK.Validate|$$STK|$$RET
DBP. Stack handle is valid: $$RET
ENR.
Remarks
-
Limitations:
-
See also:
• STK.New - Create a new stack