HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
RECORD (extension)
Chapter 10 451
STRUCTURE /iarray/
BYTE elem_count
INTEGER arr(100)
END STRUCTURE
RECORD /intarray/ iarray1
RECORD /iarray/ iarray2
! The next assignment won't work. The two
! records are not of the same structure.
iarray1 = iarray2 ! Invalid
When performing I/O on structures and records, composite record and field references can
appear only in unformatted I/O statements. They are not allowed in formatted, list-directed,
or namelist-directed I/O statements. However, simple field references can appear in all types
of I/O statements. For information about I/O, see Chapter 9, “I/O formatting,” on page 235.
A record name or composite field reference can appear as either a formal or an actual
argument to a subroutine or function. Formal and actual arguments must have the same size
as well as the same number, type, and order of fields.
Composite record and field arguments to subroutines and functions are passed by reference,
just like other HP Fortran arguments.
Adjustable arrays are allowed in RECORD statements that declare formal arguments.
Do not name a field with any of the following:
Logical constants, .TRUE. and .FALSE.
Logical operators, such as .OR., .AND., and .NOT.
Relational operators, such as .EQ., .LT., and .NEQV.
The name of a defined operator
Related statements
STRUCTURE and TYPE
Related concepts
For related information, see the following:
“Derived types” on page 123
Allocatable arrays” on page 64
Arguments” on page 171
“Procedures” on page 156