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 Array

Previous Top Next


MiniRobotLanguage (MRL)

 

STK.To Array

Copy a stack to a new array.

 

 

Intention

 

The STK.To Array command copies a stack to a new array.

This is useful when you need to work with the stack elements in an array format.

 

The elements will be copied to a new array.
The original stack handle will still be valid and all elements will be in the stack as before.

 

 

 

Illustration

 

Before STK.To Array operation:

 

Stack: [1, 2, 3]

 

After STK.To Array operation:

 

Array: [1, 2, 3]

 

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

 

 

 

Syntax

 

 

STK.To Array|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 array.

 

 

Example

 

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

' STK.To Array - Sample

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

STK.New|$$STK

STK.Push|$$STK|1

STK.Push|$$STK|2

STK.Push|$$STK|3

STK.To Array|$$STK|$$ARR

ARR.Count|$$ARR|$$RES

DBP.Array has $$RES items.

ARR.End|$$ARR

STK.End|$$STK

ENR.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: