TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-128
#DELTA Built-In Function
encounters the ^\command or the end of the commands in the variable level. When the
macro exits, the buffer and current pointer value remain where the macro left them.
The only way to pass arguments to #DELTA macros is to load the arguments into
variable levels before calling the macro, then, from within the macro, get the contents
of the variables.
The P Command
The P command writes a range of text to the output file. The range of text can be
specified either with an X register value (X lines of text, starting at the current pointer
position) or with X and Y register values (character Y through character X). You cannot
represent a partial line in a file. If you output a line fragment, that fragment becomes a
new line in the output file.
#DELTA does all file I/O in PLAIN mode.
The Q Command
The Q command moves a value from a numeric variable level into the X register. The
variable level name must be terminated by a dollar sign.
To move a numeric variable level into text, you can either insert the variable level
directly with the G command or move the value into the X register with Q and then
insert the contents of the X register into text with the backslash command (that is,
Qvar$\).
The U command is the complementary function of the Q command.
The S Command
The S command searches the buffer for a specified string, starting at the current
position. The search is not case-sensitive. The contents of the X register specify the
search direction-a positive value means search forward; a negative value, backward-
and how many occurrences of the string to search for before stopping. The string to be
sought follows the S command and is normally terminated by a dollar sign. If the
search string contains a dollar sign, you can use the @ flag to specify a different
delimiter; for example:
54> #DELTA This is a $test string
#DELTA 55> bj @s/$test/ v
#DELTA 55> EOF!
This is a $test(.) string
#DELTA 56>
In this example, the string “$test” contains a dollar sign, so you use the @ flag to
specify a slash (/) as the delimiter. The new delimiter must follow the S command.
Using the @ flag changes the delimiter for only the S command that it modifies.
If the search direction is forward, the pointer is set to the right of the matching string; if
the search is backward, the pointer is set to the left of the match.