|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Arrays and Data-Structures > LST. - List Arrays > List-Operations > Smart Package Robot 's List Commands |
MiniRobotLanguage (MRL)
LST.Next
Get the handle to the next node in the list
Intention
The LST.Next command retrieves the handle to the next node in a list. This is useful for traversing a list sequentially. If the current node is the last node in the list, the result will be 0.
Syntax
LST.Next|$$LST|$$NOD[|$$RES]
Parameter Explanation
$$LST - The list identifier, typically a numeric value or a variable that contains a number.
$$NOD - The handle of the current node.
$$RES - (Optional) Variable to hold the handle of the next node. If omitted, the result is placed on the Top of Stack (TOS).
Example
'***********************************
' LST.Next Sample
'***********************************
' 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 next node
LST.Next|$$NOD|$$RES
DBP. Next node handle: $$RES
' End the list
LST.End|$$LST
Remarks
-
Limitations:
- The list must be initialized using LST.New before using this command.
- The current node handle must be valid.
See also:
• LST.First - Get First Node in List
• LST.Prev - Get Previous Node in List