JXX-Commands: "Jump If ..."

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > JXX. - Jump - Instructions >

JXX-Commands: "Jump If ..."

JNT. - Jump-If-No-Timeout

Previous Top Next


MiniRobotLanguage (MRL)

 

JNT. Conditional Jump

Jump If Timeout-Flag is Not set

 

Intention

 

This command can be used to test the TimeOut-Flag and Jump to a label if the TimeOut is Not set. Usage is simple:

 

STW.Xwt|0|nowi

JNT.allOk

MBX.We are with an error

ENR.

'--------------

:ero

DBP. Everything is Ok

END.

 

You can use a variable that contains a label (dynamic jumping). Here is an example:

 

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

' JNT - Example with dynamic jumping

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

IVV.$$INP=1

 $$LAB=ero

ELSE.

 $$LAB=okp

EIF.

STW.Xwt|0|nowi

JNT.$$LAB

END.

:okp

MBX.We are here

ENR.

'--------------

:ero

DBP. AN Error has happened!

END.

 

The command can be switched from default mode (Jump Mode)  into "Gosub Mode" if you prefix the Label-Parameter P3 with a colon. Here is an example:

 

STW.Xwt|0|nowi

JNT.:ero

MBX.We are here

ENR.

'--------------

:ero

DBP. Anything is Ok!

RET.

 

 

 

Syntax

 

 

JNT.P1

 

 

Parameter Explanation

 

P1  - Label or Variable that evaluates to a Label.

         If it starts with a ":" (colon) a JSR. - Jump SubRoutine (Label) (GOSUB like)

        Jump is done instead of the normal JMP. - Jump to Label (GOTO like) Jump..

 

 

 

Example

 

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

' JNT - Example

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

STW.Xwt|0|nowi

JNT.allOk

MBX.We are with an error

ENR.

'--------------

:ero

DBP. Everything is Ok

END.

 

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

' Advanced JNT - Example (using :Label)

' this one makes a GSB. like-Jump.

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

STW.Xwt|0|nowi

JNT.:ero

MBX.We are here

ENR.

'--------------

:ero

DBP. Anything is Ok!

RET.

 

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

' JNT - Example with dynamic jumping

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

IVV.$$INP=1

 $$LAB=ero

ELSE.

 $$LAB=okp

EIF.

STW.Xwt|0|nowi

JNT.$$LAB

END.

:okp

MBX.We are here

ENR.

'--------------

:ero

DBP. AN Error has happened!

END.

 

 

 

Remarks

 

There are two Systemvariables, representing the state of the timeout-flag:

 

#tio#   -       Timeout-Flag

#til#   -       Timeout-Line-Number

 

 

 

 

Limitations:

 

-

 

 

See also:

 

    1.6.1. Program Flow Control

    3.1 Systemvariables

    JIT. - Jump if TimeOut

    ITO. / NTO. - If TimeOut

    STF. - Set TimeOut Flag

    JIV. - Jump-If-Variable

    JIZ. - Jump-If-Zero

    JOR. - Jump On Repeat-Count

    JME. - Jump on More or Equal

    JLE. - Jump on Less or Equal

    JMP. - Jump to Label

    JSR. - Jump SubRoutine (Label)