October 1, 1979 COMMAND MACROS CREATION
MACROS -- EXAMPLES
11.2.1.5 Additional Macro Examples __________________________________
Example _______:
Consider the macro:
SA
T &115
RET
This macro will TYPE a specified number of lines and then RETURN
the display to the position before the TYPE was performed. If no
parameter is specified in invoking this macro or if the parameter
is left null the number of lines typed defaults to 15.
Example _______:
If, instead, the macro had been specified as:
SA
T &1
RET
then leaving out the parameter would result in an error message
and none of the three commands in the macro would be executed. If
the parameter were left null the commands would be executed, but
an error would occur because TYPE has a required parameter. For
example, consider a macro which retrieves a file, locates a
pattern at the end of the format code macro definitions (to make
sure they are all defined) and then travels to a particular
Decimal Block. This might be written as:
g/&1&r'Filename?'
l/!.end of macros
gdl/&2&r'Decimal Block#?'
If &1 or &2 are not specified when the macro is invoked, the
message "Filename?" or "Decimal Block#?" will be printed when that
line in the macro is reached.
FRESS Resource Manual Release 9.1 FRESS RSection 7.2 -- 255
Previous Page Next Page