ARS. - Stack Operations

<< Click to Display Table of Contents >>

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

ARS. - Stack Operations

ARS.StkPush

Previous Top Next


MiniRobotLanguage (MRL)

 

ARS.StkPush

Push a value onto the stack.

 

 

Intention

 

The ARS.StkPush command pushes a value onto the top of the stack. The stack is a Last-In-First-Out (LIFO) data structure, meaning the last element pushed will be the first one to be popped.

 

 

Illustration:

Stack Structure:

┌───────────────┐

│ NewValue      │  ← Pushed

├───────────────┤

│ ExistingValue │

└───────────────┘

 

Syntax

 

ARS.StkPush|$$ARR|$$VAL

 

 

Parameter Explanation

 

P1 - $$ARR The handle of the stack.

P2 - $$VAL The value to push onto the stack.

 

 

Example

 

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

' ARS.StkPush - Sample Script

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

' Create a new stack

ARS.New|$$STK

' Push a value onto the stack

ARS.StkPush|$$STK|FirstValue

DBP.Value pushed onto the stack.

' End the script

ENR.

 

 

Remarks

 

-

 

 

Limitations:

- The stack must be initialized before using this command.

 

See also:

 

ARS.New

ARS.StkPop

ARS.StkPeek