CONVERT= specifier

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


<Syntax>

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.

<Semantics>

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:

'BIG_ENDIAN'
Same as 'BIG_IEEE';
'BIG_IEEE'
Big-endian IEEE (including 128-bit quad precision);
'BIG_IEEE_DD'
Big-endian IEEE (but quad precision is double-double);
'BIG_NATIVE'
Big-endian with native floating-point;
'LITTLE_ENDIAN'
Same as 'LITTLE_IEEE';
'LITTLE_IEEE'
Little-endian IEEE (including 128-bit quad precision);
'LITTLE_IEEE_DD'
Little-endian IEEE (but quad precision is double-double);
'LITTLE_NATIVE'
Little-endian with native floating-point;
'NATIVE'
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.

<Related>

INQUIRE statement, OPEN statement