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 Que

Previous Top Next


MiniRobotLanguage (MRL)

 

STK.To Que

Copy a stack to a new queue.

 

 

Intention

 

The STK.To Que command copies a stack to a new queue.

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

 

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

 

 

 

Illustration

 

Before STK.To Que operation:

 

Stack: [1, 2, 3]

 

After STK.To Que operation:

 

Queue: [1, 2, 3]

 

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

 

 

 

Syntax

 

 

STK.To Que|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 queue.

 

 

Example

 

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

' STK.To Que - Sample

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

STK.New|$$STK

STK.Push|$$STK|1

STK.Push|$$STK|2

STK.Push|$$STK|3

STK.To Que|$$STK|$$QUE

QUE.Count|$$QUE|$$RES

DBP.Queue has $$RES items.

QUE.End|$$QUE

STK.End|$$STK

ENR.

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: