HP 3000 Manuals

RETURN [ HP Transact Reference Manual ] MPE/iX 5.0 Documentation


HP Transact Reference Manual

RETURN 

Terminates a PERFORM block.

Syntax 

RETURN[(level)];

RETURN transfers control from a PERFORM block to another statement.
RETURN is also used to return to a database access loop called with the
PERFORM option.

Statement Parts 

none       Transfers control to the statement immediately following the
           last PERFORM statement executed; also used to return to
           database access loop called with the PERFORM option.

level      Transfers control to the statement immediately following one
           of the previous PERFORM statements in the command sequence.

           If level is:  then Transact:

           1-128         Skips that many PERFORM levels and transfers
                         control to the statement following the correct
                         PERFORM statement.

           @             Transfers control to the statement following the
                         top PERFORM statement in the current command
                         sequence.  Control passes through all active
                         perform levels.

Examples on the next page show how the RETURN verb works.

Examples 

     MAIN:
        PERFORM A;
        EXIT;
        .
        .
     A:
        PERFORM B;
        .
        .
        RETURN;
     B:
        PERFORM C;
        .
        .
        RETURN;
     C:
        PERFORM D;
        .
        .
        RETURN;
     D:
        PERFORM E;
        .
        .
        RETURN;
     E:
        .
        .
     IF(VALUE)="SAM" THEN

        RETURN;                        <<Transfer control to first           >>
                                       <<statement following PERFORME;       >>
     IF(VALUE)="ALLAN" THEN

        RETURN(1);                     <<Transfers control to first          >>
                                       <<statement following PERFORMD;       >>
     IF(VALUE)="BROWN" THEN

        RETURN(@);                     <<Transfers control to first          >>
                                       <<statement following PERFORMA;       >>



MPE/iX 5.0 Documentation