HP Pascal/iX Reference Manual (31502-90022)

11- 12
anyp := ptr2;
...
ptr1 := anyp;
...
END;
Globalanyptr.
The predefined type globalanyptr is a pointer type that is assignment
compatible with any other pointer type. It can be used to defeat type
checking on pointers.
A pointer of any type can be assigned to a pointer of type globalanyptr,
and a pointer of type globalanyptr can be assigned to any pointer type.
However, since pointers of type globalanyptr are not bound to a base
type, they cannot be dereferenced. (In order to dereference a pointer of
type globalanyptr, it must first be type coerced or assigned to a proper
pointer type.)
Globalanyptr takes the form of a
long pointer
. It can represent any
address on the machine. A more efficient type of pointer called
localanyptr can be used in a program that has no need for long pointers.
Permissible Operators
assignment :=
relational =, <>
Example
VAR
ptr1 : pointer_type_1;
ptr2 : pointer_type_2;
anyp : globalanyptr;
BEGIN
...
anyp := ptr1;
anyp := ptr2;
...
ptr1 := anyp;
...
END;
Anyptr.
The predefined type anyptr is a pointer type that is assignment
compatible with any other pointer type. It can be used to defeat type
checking on pointers.
A pointer of any type can be assigned to a pointer of type anyptr, and a
pointer of type anyptr can be assigned to any pointer type. However,
since pointers of type anyptr are not bound to a base type, they cannot
be dereferenced. In order to dereference a pointer of type anyptr, it
must first be type coerced or assigned to a proper pointer type.
Anyptr takes the form of a
long pointer
. It can represent any address on
the machine. A more efficient type of pointer called localanyptr can be
used in a program that has no need for long pointers.
Anyptr is equivalent to globalanyptr; however, globalanyptr and
localanyptr are the recommended types to use.
Permissible Operators
assignment :=
relational =, <>
Example
VAR
ptr1 : pointer_type_1;
ptr2 : pointer_type_2;
anyp : anyptr;