HP Pascal/iX Reference Manual (31502-90022)
Table Of Contents
- Top of Document
- Preface
- Chapter 1 Introduction
- Chapter 2 Language Elements
- Chapter 3 Data Types
- Chapter 4 Expressions
- Chapter 5 The Declaration Section
- Chapter 6 Statements
- Chapter 7 Program Structure
- Chapter 8 Procedures and Functions
- Chapter 9 Standard Routines
- Chapter 10 Input and Output
- Chapter 11 System Programming Extensions
- Chapter 12 Compiler Options

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: