TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-123
#DELTA Built-In Function
#DELTA 67> EOF!
agh!
The EI Command
The EI command opens a file for input. To read a file, you must open the file and
specify that the file is open for input. You cannot open the same file for both input and
output, and you can have only one file open for input and one file open for output at the
same time. If you try to open a nonexistent file for input, an error occurs.
If you follow the EI command with a file name, TACL closes the file currently open for
input and opens the named file. If you omit the file name, TACL closes the file currently
open for input. If you leave a file open when you exit from #DELTA, TACL closes it
automatically.
If you specify a file name with EI, you must end the file name with a dollar sign. If the
file name contains a dollar sign, you must use the @ flag with the command to specify
another delimiter. The delimiter is the first character that follows the command. For
example, the command @EI/$KYRIE.LEE.TESTSRC/ uses slashes (/) as its
delimiters.
This example shows how you can use EI to open a file whose name is supplied as an
argument:
#PUSH fn opfl
#SET fn %1% == Save file name in fn
#SET /TYPE DELTA/ opfl @EI/[fn]/ == Build custom EI command
[#DEF delcomm DELTA |BODY| == Define DELTA commands
...
Mopfl$ == Invoke custom EI command
...
]
#DELTA /COMMANDS delcomm/ == Invoke DELTA commands
The EO Command
The EO command opens a file for output. To write to a file, you must open the file and
specify that the file is open for output. You cannot open the same file for both input and
output, and you can have only one file open for input and one file open for output at the
same time. If a file opened for output does not exist, TACL creates an edit file with that
name; if the file does exist, #DELTA appends the lines it writes to the end of the file.
If you follow the EO command with a file name, TACL closes the file currently open for
output and opens the named file. If you omit the file name, #DELTA closes the file
currently open for output. If you leave a file open when you exit from #DELTA, TACL
closes it automatically.
If you specify a file name with EO, you must end the file name with a dollar sign. If the
file name contains a dollar sign, you must use the @ flag with the command to specify
another delimiter. The delimiter is the first character that follows the command. For
example, the command @EO’$FURD.UFFDA.TESTSRC’ uses apostrophes (’) as its
delimiters.