JXX-Commands: "Jump If ..."

<< Click to Display Table of Contents >>

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

JXX-Commands: "Jump If ..."

JIT. - Jump-If-Timeout

Previous Top Next


MiniRobotLanguage (MRL)

 

JIT. Conditional Jump

Jump If Timeout-Flag is set

 

Intention

 

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

 

STW.Xwt|0|nowi

JIT.ero

MBX.We are here

ENR.

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

:ero

DBP. AN Error has happened!

END.

 

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

 

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

' JIT - Example with dynamic jumping

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

IVV.$$INP=1

 $$LAB=ero

ELSE.

 $$LAB=okp

EIF.

STW.Xwt|0|nowi

JIT.$$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

JIT.:ero

MBX.We are here

ENR.

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

:ero

DBP. AN Error has happened!

RET.

 

 

 

Syntax

 

 

JIT.P1

JIT.: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

 

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

' JIT - Example

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

STW.Xwt|0|nowi

JIT.ero

MBX.We are here

ENR.

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

:ero

DBP. AN Error has happened!

END.

 

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

' Advanced JIT - Example (using :Label)

' this one makes a GSB. like-Jump.

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

STW.Xwt|0|nowi

JIT.:ero

MBX.We are here

ENR.

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

:ero

DBP. AN Error has happened!

RET.

 

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

' JIT - Example with dynamic jumping

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

IVV.$$INP=1

 $$LAB=ero

ELSE.

 $$LAB=okp

EIF.

STW.Xwt|0|nowi

JIT.$$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

    JNT. - Fump If-No 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)