DECIMAL= specifier

Standard: F77 F90 F95 F2003 F2008 F2018 Example program


<Syntax>

DECIMAL = expression

The expression must be a scalar character expression. It is permitted in the INQUIRE, OPEN, READ and WRITE statements. In the INQUIRE statement, it must be a variable designator, and is assigned the value 'COMMA', 'POINT' or 'UNDEFINED'; in all other statements it must evaluate to 'COMMA' or 'POINT' (ignoring case).

<Semantics>

The DECIMAL= specifier determines the default decimal edit mode (for OPEN), returns the default decimal edit mode (for INQUIRE), or specifies the decimal edit mode (for READ and WRITE).

The DECIMAL= specifier is only permitted in an OPEN, READ or WRITE statement that refers to a formatted file.

If a file is preconnected, or is opened without a DECIMAL= specifier, the default decimal edit mode is 'POINT'.

The decimal edit mode determines the character that is used for input and output to indicate the decimal position; if the edit mode is 'POINT' then a decimal point is used, whereas if it is 'COMMA' a decimal comma is used. When the decimal edit mode is 'COMMA', list-directed and namelist input/output will use semi-colon (instead of comma) as a value separator.

The current decimal edit mode may be overridden within a format by use of the DP (decimal point) and DC (decimal comma) edit descriptors.

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

<Related>

FORMAT statement, INQUIRE statement, OPEN statement, READ statement, WRITE statement