|
<< 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.DelNext
Remove the node after a given node in a list
Intention
The LST.DelNext command removes the node immediately after a specified reference node in a list. This is useful when you need to delete a specific node relative to another node in the list.
The command requires the list handle (`$$LST`) and the handle of the reference node (`$$NOD`). If the reference node is the last node in the list or the list is empty, the command will have no effect.
Syntax
LST.DelNext|$$LST|$$NOD
Parameter Explanation
$$LST - The list identifier, typically a numeric value or a variable that contains a valid list handle.
$$NOD - The handle of the reference node. The node immediately after this node will be removed.
Example
'***********************************
' LST.DelNext 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
' Remove the node after the first node
LST.DelNext|$$LST|$$NOD
' Verify the removal
LST.Count|$$LST|$$CNT
DBP. Number of nodes after removal: $$CNT
' Clean up
LST.End|$$LST
ENR.
Remarks
-
Limitations:
- The list must be initialized and contain at least two nodes.
- The reference node handle must be valid.
See also:
• LST.DelPrev - Remove the Node Before a Given Node