HP Pascal/iX Reference Manual (31502-90022)

4-: 19
File Buffer Selector
A file buffer selector accesses the contents, if any, of the file buffer
variable associated with the current position of a file. The selector
follows a file designator and consists of the caret symbol (^).
A file designator is the name of a file or the selected component of a
structure which is a file. The @ symbol may replace the caret. If the
file buffer variable is not defined at the time of selection, a run-time
error occurs.
Syntax
File_selector:
Example
PROGRAM show_file_selector(output);
VAR
f1: FILE OF integer;
BEGIN
rewrite(f1);
f1^:= 5;
put(f1);
reset(f1);
IF f1^ <> 5 THEN
writeln('error')
ELSE
writeln('success');
END.
Output:
success
Pointer dereferencing
A pointer variable points to a dynamically allocated variable on the
heap. The current value of this variable may be accessed by
dereferencing its pointer value.
Pointer dereferencing
occurs when the
caret
symbol (^) appears after a pointer designator in source code. A
dereferenced pointer can be an operand in an expression.
The pointer designator may be the name of a pointer or selected component
of a structured variable that is a pointer. The @ symbol may replace the
caret. It is an error to dereference NIL or an undefined pointer value.
Syntax
Pointer_deref: