JXX-Commands: "Jump If ..."

<< Click to Display Table of Contents >>

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

JXX-Commands: "Jump If ..."

JRS. - Jump If Result

Previous Top Next


MiniRobotLanguage (MRL)

 

JRS. Conditional Jump

Jump If Result

 

Intention

 

This command can be used to test, if an specified Background- or Parallel-Robot Operation has emitted an result or not. Usage is simple:

 

SMB.

PAU.10

JRS.|result

MBX.Error we got no Result

ENR.

:result

MBX.Result is available

ENR.

 

You can use a variable that contains a label (dynamic jumping).

Here is another example:

 

SMB.

$$TIN=$$000

PAU.4

JNR.$$TIN|noresult

MBX.Yes we got an Result

ENR.

:noresult

MBX.No Result was available

ENR.

 

 

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:

 

SMB.

:Retry

JNR.|:test

PAU.0.25

JNR.|Retry

ENR.

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

:test

DBP. No Result yer!

PAU.0.1

RET.

 

JNR. is the negative version of JRS.

 

 

 

Syntax

 

JRS.[P1]|P2

JRS.[P1]|:P2

 

 

 

Parameter Explanation

 

P1  -  (optional) Variable that evaluates to a valid Ticket-Number,

       that is connected with a Background Operation or a Parallel Robot. If omitted

       the last emitted Ticket-Number is used.

 

       

P2  - 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

 

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

' JRS - Example

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

SMB.

:Retry

PAU.0.25

JRS.|out

JMP.Retry

ENR.

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

:out

DBP. Result Ok!

ENR.

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

    ! Smart Package Robot 's Parallel Robot Operations

    JNR. - Jump if no Result

    GRS. - Get Result

    DRS. - Drop Result

    WRS. - Wait for Result

    PRR. - Parallel-Robot-Run

    PRE. - Parallelrobot-Run-End