Stack Commands

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Stack-Operations >

Stack Commands

PNS. - PUsh Numeric Variables on the User-Stack

Previous Top Next


MiniRobotLanguage (MRL)

 

PNS. Command

PUsh Numeric Variable(s) on the user stack

 

 

Intention

 

Takes up to 25 variables, which content is been pushed on Top of the User-Stack/the Queue. Counterpart to POV. (POP Variables from Stack).

As the command tries to resolve Numbers and Formulas, you can get a "0" or "1" result if you use it for strings taht can in any way be resolved to a formula.

Therefore Use PSS. for Strings and PNS. for numbers.

 

You can Push any variables onto the stack. PUV. will do a type-dependend variable resolution. This will only work, if the Variables have been defined with a type.

Otherwise the resolution will be a Binary-compatible Variable-resolution.

 

You can PUV. any Stack Content into the variable(s).

 

While PVS. and PUS. explicitly does NOT resolve variables and special-folder, POP. PUV. PSS., PNS do just that.

PVS. - Put Variable-Name on Stack without resolving anything

PSS. - Resolve Variables and Special-Folders before putting the Variable on Stack

PNS. - Do a numerical resolution and calculate Formulas in the Variable (if they are in ()). Then put the result on TOS.

PUV. - Do a Variable-Type dependent Variable resolution. Variables that are defined in some way have a Variable-Type (See GVT.-Command)

PUS. - Put Variable-Name on Stack without resolving anything. Unlike PVS., Variables will not be split if separated with |"|". Just the whole Parameter will be placed on TOS.

 

Sample-Code and a Stack-Printout:

 

$$LAA="Hallo you "

$$LAB=(1+2+3*45)

PNS.People|$$LAA|$$LAB

DMP.6

POV.$$TXA|$$TXB|$$TXC

DMP.6

PRT.$$TXA#$$TXB##$$TXC

MBX.!

 

PNS_1

 

 

 

Please compare the Result with the Results from PSS.

 

 

$$LAA="Hallo you "

$$LAB=(1+2+3*45)

PSS.People|$$LAA|$$LAB

DMP.6

POV.$$TXA|$$TXB|$$TXC

DMP.6

PRT.$$TXA#$$TXB##$$TXC

MBX.!

 

PSS_1

 

 

 

 

Syntax

 

 

PNS.[P1][|P2]...[|PX]

 

 

Parameter Explanation

 

P1 - Variable

 

P2 - Px - (optinal) more Variables

 

The Stack being used is the actual User-Stack.

It can be the Local User Stack or the Global User-Stack, which depends on Settings done with STS.-Command.

 

If the Popped items are deleted from stack or not also depends on the Settings done with STS.

 

 

 

 

Example

 

' Pop Variables Content from User-Stack

'DBM.2

DBP.Items on Stack: #tos#

: $$TXA=(1*10+23)

: $$TXB=+555 E01

DBP. Variables Content (1): $$TXA-$$TXB

PNS.$$TXA|$$TXB

DBP. Items on Stack: #tos#

DBP. Item on TOS: <$dtos$>

DMP.4

: $$TXA=

: $$TXB=

DBP. Variables have been cleared (2): $$TXA-$$TXB

DMP.4

POV.$$TXB,$$TXA

DBP. Variables Content after POV. (3): $$TXA-$$TXB

MBX.Ready

END.

 

 

Remarks

 

-

 

 

 

Limitations:

 

25 Variables is the maximum number of possible parameters.

 

 

 

See also:

 

    The global and local Stack

    STS. - Set STack Settings

    STJ. - STack Job

    STV. - Stack To/from Variable

    PUS. - Push Parameter onto Stack/Que

    POP. - POP Variable from Stack

    POV. - POp Variables from User-Stack