Special Macros
The following special macros are used by the Terminal Monitor to control the environment and to return results to the user:
{begintrap}
Executed at the beginning of a query
{endtrap}
Executed after the body of a query is passed to the DBMS Server
{continuetrap}
Executed after the query completes. The difference between this and {endtrap} is that {endtrap} occurs after the query is submitted, but before the query executes. {continuetrap}, on the other hand, is executed after the query executes.
{editor}
Defines the on-line editor to use in the \edit command.
Windows: To change the default vi editor to the ed editor, enter:
{define;{editor};/bin/ed}
which invokes the ed editor in response to the \e command.
{shell}
Defines the pathname of a shell to use in the \shell command
{tuplecount}
Is set after every query (but before {continuetrap} is sprung) to be the count of the number of rows that satisfied the qualification of the query in a retrieve, or the number of rows changed in an update. It is not set for some utility functions (such as define view). If multiple queries are run at once, it is set to the number of rows that satisfied the last query run.
Example:
For example, to print out the number of rows affected automatically after each query, enter the following commands:
{define;~{begintrap};~{remove;~{tuplecount}}}
{define;~{continuetrap};
^{ifsame;@{tuplecount};~{tuplecount};;~~\
^^{type~@{tuplecount}~tuples~touched}}}
Last modified date: 08/14/2024