CONVERT= specifier

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


CONVERT = expression

The expression must be a scalar default character expression. It is permitted in the INQUIRE and OPEN statements. In the INQUIRE statement, it must be a variable designator, and is assigned the conversion mode of the connection or 'UNDEFINED'; in the OPEN statement it must evaluate to one of the allowed values (ignoring case).

This specifier is a non-standard extension.


The CONVERT= specifier is only permitted in an OPEN statement that refers to an unformatted file, and specifies the conversions to be applied when reading or writing that file. This is useful when the unformatted file was generated on a system with different endianness or a different floating-point format. The possible values for CONVERT= are:

Same as 'BIG_IEEE';
Big-endian IEEE (including 128-bit quad precision);
Big-endian IEEE (but quad precision is double-double);
Big-endian with native floating-point;
Same as 'LITTLE_IEEE';
Little-endian IEEE (including 128-bit quad precision);
Little-endian IEEE (but quad precision is double-double);
Little-endian with native floating-point;
No conversion.

The default conversion mode is 'NATIVE'.

In an INQUIRE statement, the value assigned is 'UNDEFINED' if the file is connected for formatted input/output or if there is no connection.


INQUIRE statement, OPEN statement