|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > List-Operations > Smart Package Robot (SPR) List Commands |
MiniRobotLanguage (MRL)
LST.Get
Get the value of a node in a list
Intention
The LST.Get command retrieves the value stored in a specific node of a list. This is useful when you need to access the data associated with a particular node, such as when traversing or manipulating a list.
The command requires the list handle (`$$LST`), the node handle (`$$NOD`), and a variable (`$$VAL`) to store the retrieved value. If the node handle is invalid or the list is empty, the result will be an empty string or an error, depending on the context.
Syntax
LST.Get|$$LST|$$NOD|$$VAL
Parameter Explanation
$$LST - The list identifier, typically a numeric value or a variable that contains a valid list handle.
$$NOD - The handle of the node whose value you want to retrieve.
$$VAL - The variable to store the value of the node.
Example
'***********************************
' LST.Get Sample Script
'***********************************
' Create a new list
LST.New|$$LST
' Add elements to the list
LST.Add|$$LST|Hello
LST.Add|$$LST|World
' Get the first node
LST.First|$$LST|$$NOD
' Get the value of the first node
LST.Get|$$LST|$$NOD|$$VAL
' Print the value
DBP. Value of the first node: $$VAL
' Clean up
LST.End|$$LST
ENR.
Remarks
-
Limitations:
- The list must be initialized and contain at least one node.
- The node handle must be valid.
See also:
• LST.First - Get First Node in List
• LST.Set - Set Value of a Node