HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
RECORD (extension)
Chapter 10448
RECORD (extension)
Declares a record of a previously defined structure.
Syntax
RECORD /
struct-name
/
rec-name
[,
rec-name
]...
[/
struct-name
/
rec-name
[,
rec-name
] ]...
struct-name
is the name of a structure declared in a previous structure definition.
rec-name
is a record name.
Description
HP Fortran supports the RECORD statement as a compatibility extension. New programs
should use the derived type, a standard feature of Fortran 90. For more information about
derived types, see “Derived types” on page 123 and “TYPE (definition)” on page 484.
The RECORD statement declares a record variable of a structure that has been previously
defined by a STRUCTURE statement. A record variable can consist of multiple data items, called
fields
. The STRUCTURE statement is described in “STRUCTURE (extension)” on page 465.
Referencing record fields
The syntax for referencing a field in a record depends on whether the field itself is another
record (a composite reference) or not (a simple reference). Composite references have the
following syntax:
rec-name
[.
substruct-fieldname
]...
Simple references have the following syntax:
rec-name
[.
substruct-fieldname
]...
simple-fieldname
rec-name
is the name of the record in which a composite or simple field is being
referenced.
substruct-field-name
is the name of a nested structure or nested record field name, if applicable.
simple-field-name
is the name of a lowest-level field, defined with a type declaration
statement. As indicated by the syntax, the field could be part of a nested
structure or nested record.