LST. - List Management

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > LST. - List Arrays > Deque-Operations >

LST. - List Management

LST.PopLast

Previous Top Next


 

MiniRobotLanguage (MRL)

 

LST.PopLast

Remove and retrieve the last value from the List.

 

 

Intention

 

The LST.PopLast command removes the last value from the List and stores it in a variable. This is useful when you need to process items in a LIFO (Last-In-First-Out) manner.

The List is modified, and the last item is permanently removed.

 

 

Syntax

 

 

LST.PopLast|P1|P2

 

 

Parameter Explanation

 

P1 - (Variable)

 The handle of the List to pop from.

P2 - (Variable)

 The variable to store the popped value.

 

 

Example

 

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

' LST.PopLast - Sample

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

LST.New|$$LST

LST.Add|$$LST|Hello

LST.Add|$$LST|World

LST.PopLast|$$LST|$$RES

DBP.Popped value: $$RES

LST.Count|$$LST|$$COUNT

DBP.Items remaining: $$COUNT

LST.End|$$LST

ENR.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: