STK.Import and STK.Export

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > STK. - Stack > STK.-Import/Export >

STK.Import and STK.Export

STK.To List

Previous Top Next


MiniRobotLanguage (MRL)

 

STK.To List

Copy a stack to a new list.

 

 

Intention

 

The STK.To List command copies a stack to a new list.

This is useful when you need to work with the stack elements in a list format.

 

The elements will be copied to a new list.

The original stack handle will still be valid and all elements will be in the stack as before.

 

 

Illustration

 

Before STK.To List operation:

 

Stack: [1, 2, 3]

 

After STK.To List operation:

 

List: [1, 2, 3]

 

The elements are copied to a new list. The original stack remains unchanged.

 

 

 

Syntax

 

 

STK.To List|P1|P2

 

 

Parameter Explanation

 

P1 - (Variable)

 The handle of the stack to convert.

 

P2 - (optional, Variable)

 The variable to store the handle of the new list.

 

 

Example

 

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

' STK.To List - Sample

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

STK.New|$$STK

STK.Push|$$STK|1

STK.Push|$$STK|2

STK.Push|$$STK|3

STK.To List|$$STK|$$LST

LST.Count|$$LST|$$RES

DBP.List has $$RES items.

LST.End|$$LST

STK.End|$$STK

ENR.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: