Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@RETURN - Return from EDT procedures

&pagelevel(3)&pagelevel

The @RETURN statement is used in EDT procedures to terminate the execution of the procedure and return to the point at which it was called. If the @RETURN statement is issued outside of an EDT procedure then the EDT session or, after @DIALOG, the screen dialog is terminated.

Operation

Operands

F mode, L mode

@RETURN

[message]

message

The message operand can contain any text which is passed to the calling
program when EDT is called as a subroutine.

The message operand may only be specified when EDT is called via the
subroutine interface or on the return from an EDT procedure.

In this statement, it is obligatory for at least one blank to be entered between the statement name and any specified operands.

If the @RETURN statement is issued outside of an EDT procedure then it has the same effect as @HALT (see the @HALT statement).

If @RETURN is used in @DO or @INPUT procedures then execution of the procedure is aborted and processing continues at the point where the procedure was called. In this case, the message operand is ignored.

Note

A @RETURN statement in a @DO procedure also aborts any external loop, i.e. the procedure is not executed as many times as is specified by means of the start value, end value and the increment of the loop counter in the @DO statement (see section “EDT procedures” and @DO statement).

Example 1

1.     @PROC 6 ------------------------------------------------------- (1)
1.     @ @SET #S1 = 'I AM #S1'
2.     @ @SET #S2 = 'I AM #S2'
3.     @ @PRINT #S1
4.     @ @RETURN ----------------------------------------------------- (2)
5.     @ @PRINT #S2
6.     @END ---------------------------------------------------------- (3)
1.     @DO 6 --------------------------------------------------------- (4)
  #S01 I AM #S1
(1)Work file 6 is opened for processing.
(2)

When the procedure is executed in work file 6 for this statement then the following statements are no longer executed.

(3)Execution of work file 6 is started.
(4)The procedure is executed.


Example 2

1.     AAAA
2.     BBBB
3.     CCCC
4.     @PROC 7 ------------------------------------------------------- (1)
1.     @ @PRINT ! ---------------------------------------------------- (2)
2.     @ @RETURN ----------------------------------------------------- (3)
3.     @END
4.     @DO 7,!=%,$ --------------------------------------------------- (4)
1.0000 AAAA
4.
(1)The procedure is created in work file 7.
(2)

When the statements present in the procedure are executed, the line addressed by the loop counter ! is to be output.

(3)

The execution of the statements in the procedure is terminated here irrespective of whether the loop counter has reached the upper limit or not.

(4)

The procedure is called. In this case, the loop counter ! is to take on the values 1 to (%=1, $=3). However, due to the @RETURN present in the procedure, the loop counter is not incremented.