Terminate True Clause [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Terminate True Clause
Purpose
Terminates a conditional section within a macro.
Default Syntax
$T
Description
This command, when used within a macro, enables you to conditionally
execute selected portions of macros, depending on the value of a settable
flag. This command is intended to be used in conjunction with the
Test/Set/Clear Flag ($t) command. When HP EDIT encounters this command,
it continues executing the remainder of the macro. HP EDIT may or may
not have executed the conditional section of the macro, depending on the
value of the flag preceding the conditional section.
Requirements
In order for this command to function properly, you must construct a
macro that contains a conditional section. The conditional section
consists of a portion of the macro that you want to execute only if the
flag is set (true). The Test/Set/Clear Flag command initiates the
conditional section and the Terminate True Clause command terminates the
conditional section.
Syntax Considerations
Since the standard Meta key (ESC) is displayed as ^[ when inserted in a
macro, HP EDIT provides the dollar sign ($) as an alternate Meta key.
Consequently, you should use the recommended syntax of $T within a macro.
Refer to the Define Macro command for information about macro syntax, and
to the Test/Set/Clear command for information about conditional macro
components and for additional information about conditional macro syntax.
Procedure
To use this command within a macros:
1. Construct the macro so that this command terminates the
conditional section, as in:
mZ=IAll employees/^m$t; over 40/^m$T; must respond./^m
Examples
To construct, define, and execute a conditional macros:
1. Insert a new line in text by executing the Insert Line (I)
command.
2. Type the following macro beginning at the start of the line:
mX=3+$t2D+$T5+
3. Press / and Return to exit Text Entry mode and enter Command mode.
4. Press the z key. HP EDIT removes the macro from the screen and
stores it for subsequent execution.
5. Press the m key. HP EDIT displays the following prompt on the
message line:
Specify macroname
6. Press the X key. HP EDIT moves the cursor down three lines and
tests the flag when it encounters the imbedded Test/Set/Clear Flag
($t) command. If the flag is true, HP EDIT:
* Deletes two lines
* Moves the cursor down another line
* Ends the conditional clause when it encounters the
Terminate True Clause command
HP EDIT then moves the cursor down another five lines regardless
of the flag setting.
Related Commands
Test And Execute Macro
Test And Go To Macro
Test/Set/Clear Flag
MPE/iX 5.0 Documentation