HP Pascal/iX Reference Manual (31502-90022)

1- 4
Halt Procedure.
The
halt
procedure causes an abnormal termination of a program.
Heap Procedures.
The procedure
mark
saves the allocation state of the heap. The procedure
release
restores the allocation state of the heap to a state previously
marked. This has the effect of deallocating all storage allocated by the
procedure
new
since the time
mark
was called.
Identifiers.
The underscore character (_) can appear in identifiers, but not as the
first character.
File Input/Output.
A file can be opened for direct access with the procedure
open
. Direct
access files have a maximum number of components indicated by the
function
maxpos
and have a current number of written components,
indicated by the function
lastpos
. The procedure
seek
places the current
position of a direct access file at a specified component. Data can be
read from a direct access file or written to it with the procedures
readdir
or
writedir
that are combinations of
seek
and the standard
procedures
read
or
write
. A textfile cannot be used as a direct access
file.
A file can be opened in the "write-only" state without altering its
contents by using the procedure
append
. The current position is set to
the end of the file.
Any file can be explicitly closed with the procedure
close
.
To permit interactive input, the system defines the primitive file
operation
get
as "deferred get." Refer to
get
in Chapter 10 for more
information.
The procedure
read
accepts any ordinal type as input from text files.
Therefore, it is possible to read a Boolean or enumerated value from a
text file. It is also possible to read a value that is of type PAC or
string.
The procedure
write
writes expressions to a text file. Any ordinal type
can be a parameter. An enumerated constant can be written directly to a
text file.
Write
also writes expressions of type string or PAC.
The function
position
returns the index of the current position for any
file that is not a textfile.
The routines
page
,
overprint
,
prompt
, and
linepos
operate on textfiles.
The following lists what each routine does:
*
Linepos
returns the integer number of characters that the program
has read from or written to a textfile since the last end-of-line
marker.
*
Page
causes a page eject when a text file is printed.
*
Overprint
causes the printer to perform a carriage return without
a line feed, effectively overprinting a line.