ARS. - Queue Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Arrays and Data-Structures > ARS. - Array's > !ARS. - Queue Operations >

ARS. - Queue Operations

ARS.QuePeek

Previous Top Next


MiniRobotLanguage (MRL)

 

ARS.QuePeek

Peek at the first value in the queue.

 

 

Intention

 

The ARS.QuePeek command retrieves the first value in the specified queue without removing it.

This command is useful for inspecting the first value in the queue without altering the queue.

 

 

Illustration

 

[ Value1 Value2 Value3 ] → [ Value1 Value2 Value3 ]

 

 

Syntax

 

 

ARS.QuePeek|$$ARR[|$$VAL]

 

 

Parameter Explanation

 

$$ARR - (Variable)

The handle of the queue from which the value will be peeked.

 

$$VAL - (Optional, Variable)

The variable to store the peeked value. If omitted, the value is placed on the Top of Stack (TOS).

 

 

Example

 

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

' ARS.QuePeek - Sample

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

QUE.New|$$QUE

ARS.QuePush|$$QUE|Value1

ARS.QuePush|$$QUE|Value2

ARS.QuePeek|$$QUE|$$VAL

DBP.New peeked value: $$VAL

'

QUE.New|$$QUE

ARS.QuePush|$$QUE|10

ARS.QuePush|$$QUE|20

ARS.QuePeek|$$QUE|$$VAL

DBP.New peeked value: $$VAL

ENR.

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: