HP Pascal/iX Reference Manual (31502-90022)

6-: 14
The statement:
WITH record1, record2, ..., recordn DO
BEGIN
statement;
END;
is equivalent to:
WITH record1 DO
BEGIN
WITH record2 DO
BEGIN
...
WITH recordn DO
BEGIN
statement;
END;
...
END;
END;
Therefore, if field f is a component of both record1 and record2, the
compiler interprets an unselected reference to f as a reference to
record2.f. The synonymous field in record1 can be accessed using normal
field selection; for example, record1.f.
This interpretation also means that if r and f are records, and f is a
field of r, the statement:
WITH r DO
BEGIN
WITH r.f DO
BEGIN
statement;
END;
END;
is equivalent to
WITH r,f DO
BEGIN
statement;
END;
If a
local
or
global
identifier has the same name as a field of a
designated record in a WITH statement, then the appearance of the
identifier in the statement after DO is always a reference to the record
field. The
local
or
global
identifier is inaccessible if it happens to
have the same name as the field name in the record.
Syntax
With_statement