HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
RECORD (extension)
Chapter 10 449
Given the following structure definition and record declarations:
STRUCTURE /abc/
REAL a, b, c(5)
STRUCTURE /xyz/ xyz, xyzs(5)
INTEGER x, y, z(3)
END STRUCTURE
END STRUCTURE
RECORD /abc/ abc, abcs(100)
RECORD /xyz/ xyz
the following are composite references:
abc !composite record references
abcs(1)
xyz
abcs(idx)
abc.xyz !composite field references
abc.xyzs(3)
and the following are simple references:
abc.a
abc.c(1)
xyz.x
xyz.z(1)
abc.xyz.x
abcs(idx).xyz.y(1)
abcs(2).xyzs(3).z(1)
Composite references can be either to an entire record or to a record field that is itself a
structure or record.
Rules for record field
Arrays of records can be created as follows:
RECORD /student/ students(1000)
or
RECORD /student/ students
DIMENSION students (1000)
In either case a 1000-record array called students of structure student is declared.
Records can be placed in common blocks. The following code places the students array
(declared above) in the common block frosh, along with variables a, b, and c:
COMMON /frosh/ a, b, c, students