TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-122
#DELTA Built-In Function
If the position specified by the X register is outside the text in the buffer, an error
occurs. However, if you have placed a value in the Y register, #DELTA avoids the error
and loads the Y register value into the X register instead.
The B Command
The B command loads the value 0 into the X register, thus indicating the beginning of
the buffer.
The C Command
The C command moves the pointer the number of positions specified by the contents
of the X register; you can precede the C command with an X register value. The sign of
the number indicates the direction to move: forward (positive) or backward (negative).
You must use a minus sign to indicate a negative number, but positive values are
implied by the absence of a minus sign. If there is no value in the X register, 1 is
assumed.
If you use the : flag before the C command, the command returns -1 if it succeeds, or 0
if the command would try to move the pointer outside the text in the buffer. If the
command is successful, the pointer is moved the specified number of characters; if the
command fails, the pointer is not moved.
For example:
#DELTA 28> v
#DELTA 28> EOF!
This is a test string(.)
#DELTA 29> -2:c = v
#DELTA 29> EOF!
-1
This is a test stri(.)ng
#DELTA 30> 4:c=v
#DELTA 30> EOF!
0
This is a test stri(.)ng
#DELTA 31>
The D Command
The D command moves the pointer a number of characters specified by the contents
of the X register, deleting those characters in the process; you can precede the D
command with an X register value. A minus sign preceding the number specifies that
characters are to be deleted in a backward direction. You must not use a plus sign to
specify forward direction, however; a positive value is implied by the absence of a
minus sign. If there is no value in the X register, 1 is assumed. For example:
65> #DELTA argh!
#DELTA 66> 1jv
#DELTA 66> EOF!
a(.)rgh!
#DELTA 67> dht