END [ HP Transact Reference Manual ] MPE/iX 5.0 Documentation
HP Transact Reference Manual
END
Returns control to next higher level or structure.
Syntax
END[modifier];
The function of the END verb depends on the modifiers used.
Statement Parts
To specify the impact of the END verb, use one of the following
modifiers:
none At the end of a command sequence, control returns
to command level (the current command if the REPEAT
qualifier is in effect) or to the beginning of a
current level.
At the end of a program, issues the message EXIT OR
RESTART (E/R)? to which you can respond with an E
to exit from the program or an R to restart the
program. Necessary only if program branches can
cause more than one program end.
RESTART causes the following things to happen:
* List, key, update, match, and argument
registers are reset (the data register is
not reset).
* The work space is reset.
* Stack markers Z and DL are reset.
* MPE, KSAM, and form files are closed.
(LEVEL) The end of the current level. This causes control
to fall through the level to the statement
following the END(LEVEL) statement and resets the
registers to whatever their conditions were
immediately before the level sequence began.
If you use END without (LEVEL) to terminate a
level, Transact generates a loop after the first
execution of the level. The loop begins at the top
of the level. The registers are reset to whatever
their values were at the beginning of the level.
Information on levels is contained in the
description of the LEVEL verb in this chapter.
system-name The end of the executing program (name specified in
the SYSTEM statement); necessary if program is one
of several included in a text file. The registers
are reset.
(SEQUENCE) The end of a command sequence; control passes
unconditionally back to command level. The
registers are reset.
Examples
In this example, END terminates the command sequence and clears the
program registers.
$$ADD:
$PROGRAM:
PROMPT(PATH) PROG-NAME:
VERSION:
DESCRIPTION;
PUT PROGRAMS,
LIST=(PROG-NAME:DESCRIPTION);
END;
The following example terminates the program PROG1.
SYSTEM PROG1;
.
<<process program code>>
.
END PROG1;
This example terminates processing of the level, resets the program
registers to their state before to the LEVEL statement, and returns
control to the LEVEL statement.
LEVEL;
.
<<process level code>>
.
END;
The following example terminates processing of the level, resets the
program registers to their state before the LEVEL statement, and passes
control to the next statement. In this case, the next statement is the
first statement following the label, NEXT.
LEVEL;
.
<<process level code>>
.
END(LEVEL);
NEXT:
MPE/iX 5.0 Documentation