Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference
A newer version of this document is available. Customers should click here to go to the newest version.
Visible to Intel only — GUID: GUID-A4A42C94-794C-4FA0-89DF-623ACF7408CB
Visible to Intel only — GUID: GUID-A4A42C94-794C-4FA0-89DF-623ACF7408CB
Generic Bindings
User-defined I/O procedures can be type-bound procedures that use a defined-io-generic-spec (see Defined IO Procedures).
Consider the following:
TYPE LIST
TYPE(NODE), POINTER :: FIRST
CONTAINS
PROCEDURE :: FMTREAD => LIST_FMTREAD
PROCEDURE :: FMTWRITE => LIST_FMTWRITE
GENERIC,PUBLIC :: READ(FORMATTED) => FMTREAD
GENERIC,PUBLIC :: WRITE(FORMATTED) => FMTWRITE
END TYPE LIST
In the above example, LIST_FMTREAD and LIST_FMTWRITE are the type-bound defined I/O procedures. If an object of type LIST is an effective item in a formatted READ statement, LIST_FMTREAD will be called to perform the read operation.