6.1.20. STRUCTURE and RECORD
6.1.20 STRUCTURE and RECORD
Record structures are a pre-Fortran-90 vendor extension to create user-defined aggregate data types. GNU Fortran does not support record structures, only Fortran 90's “derived types”, which have a different syntax.
In many cases, record structures can easily be converted to derived types. To convert, replace STRUCTURE /
structure-name/
by TYPE
type-name. Additionally, replace RECORD /
structure-name/
by TYPE(
type-name)
. Finally, in the component access, replace the period (.
) by the percent sign (%
).
Here is an example of code using the non portable record structure syntax:
! Declaring a structure named ``item'' and containing three fields: ! an integer ID, an