JXX-Commands: "Jump If ..."

<< Click to Display Table of Contents >>

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

JXX-Commands: "Jump If ..."

RET. - RETurn from gosub

Previous Top Next


MiniRobotLanguage (MRL)

 

RET. Statement

RETurn from Gosub

 

 

Intention

 

Return from a Subroutine that was called using any of the statements below.

 

Returns to the line/statement following the Subroutine call.

 

A subroutine can be called with any of the following Instructions / Instruction-groups:

 

    JSR. - Jump SubRoutine (Label) (Same as GSB.)

    STW. - Description with the "W", or "V"-Option

    ! SCW - Search-Child-Window with the "W", or "V"-Option

    ITW. with the "W", or "V"-Option

    ICW. with the "W", or "V"-Option

    JIV. - Jump-If-Variable or

    any other of the JIX. - Jumps, when using the ":"-Label Option

    any of the FEX.-Enumeration Instructions

 

 

 

 

Syntax

 

RET.[P1]

 

 

Parameter Explanation

 

P1 - (optional) how many level you want to jump up. If omitted, the RET. Instruction will bring you just up one level. If you want to get to the Top-Level, for example in case of errors, you can write:

 

RET.all

 

this will bring you in one strike to the Top-Level of the Script. Note that all levels below have been removed from the Subprogram-Return Stack.

 

 

Speed in Ticks:

This command uses typically between 10 to 20 Ticks.

 

Example

 

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

' Example 1 - without Parameters,

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

 

[First.txt]

DBM.2

JSR.Laba

CAL.$$AAA=3+(9*$$AAA)+2.5

PRT. Resultat ist: $$AAA

END.

 

:Laba

: $$AAA=10

RET.

 

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

' Example 2 - with Parameter

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

 

DBM.2

: $$LAA=Laba

JSR.$$LAA|10

CAL.$$AAA=3+(9*$$AAA)+2.5

PRT. Resultat ist: $$AAA

END\

 

:Laba

: $$AAA=§§_01

PRT. $$AAA

RET.

 

 

 

 

 

Remarks

 

Please do not intermix RET. with RTS, because RTS is used to Return from Subprograms which are called with JNF.

 

 

 

Limitations:

 

There are no relevant depth limitations or limitations about recursive functions.

 

 

See also:

 

    JSR. - Jump SubRoutine (Label)

    RTS. - ReTurn from Subprogram

    JIV. - Jump-If-Variable

    JIZ. - Jump-If-Zero

    JNZ. - Jump if Not zero

    JOR. - Jump On Repeat-Count

    JME. - Jump on More or Equal

    JLE. - Jump on Less or Equal

    JMP. - Jump to Label

    JNF. - Jump New File