Smart Package Robot (SPR) List Commands

<< 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

LST.Set - Set Value of a Node

Previous Top Next


MiniRobotLanguage (MRL)

 

LST.Set

Set the value of a node in a list

 

Intention

The LST.Set command updates the value stored in a specific node of a list. This is useful when you need to modify the data associated with a particular node, such as when updating or correcting information in a list.

The command requires the list handle (`$$LST`), the node handle (`$$NOD`), and the new value (`$$VAL`) to set. If the node handle is invalid or the list is empty, the command will fail silently or return an error, depending on the context.

 

Syntax

 

LST.Set|$$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 update.

$$VAL - The new value to set for the node.

 

Example

 

'***********************************

' LST.Set 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

' Set a new value for the first node

LST.Set|$$LST|$$NOD|Greetings

' Verify the update

LST.Get|$$LST|$$NOD|$$VAL

DBP. Updated 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.New - Create a New List

LST.Get - Get Value of a Node

LST.First - Get First Node in List