Commit 87f56a65 by Tobias Burnus Committed by Tobias Burnus

gfortran.texi (STRUCTURE and RECORD): State more clearly how to convert them into derived types.

2013-03-11  Tobias Burnus  <burnus@net-b.de>

        * gfortran.texi (STRUCTURE and RECORD): State more clearly how
        to convert them into derived types.

From-SVN: r196602
parent 2aa953d0
2013-03-11 Tobias Burnus <burnus@net-b.de>
* gfortran.texi (STRUCTURE and RECORD): State more clearly how
to convert them into derived types.
2013-03-10 Paul Thomas <pault@gcc.gnu.org> 2013-03-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/56575 PR fortran/56575
......
...@@ -2004,10 +2004,19 @@ code that uses them running with the GNU Fortran compiler. ...@@ -2004,10 +2004,19 @@ code that uses them running with the GNU Fortran compiler.
@cindex @code{STRUCTURE} @cindex @code{STRUCTURE}
@cindex @code{RECORD} @cindex @code{RECORD}
Structures are user-defined aggregate data types; this functionality was Record structures are a pre-Fortran-90 vendor extension to create
standardized in Fortran 90 with an different syntax, under the name of user-defined aggregate data types. GNU Fortran does not support
``derived types''. Here is an example of code using the non portable record structures, only Fortran 90's ``derived types'', which have
structure syntax: a different syntax.
In many cases, record structures can easily be converted to derived types.
To convert, replace @code{STRUCTURE /}@var{structure-name}@code{/}
by @code{TYPE} @var{type-name}. Additionally, replace
@code{RECORD /}@var{structure-name}@code{/} by
@code{TYPE(}@var{type-name}@code{)}. Finally, in the component access,
replace the period (@code{.}) by the percent sign (@code{%}).
Here is an example of code using the non portable record structure syntax:
@example @example
! Declaring a structure named ``item'' and containing three fields: ! Declaring a structure named ``item'' and containing three fields:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment