Special characters: Difference between revisions
m
→In FORMAT coding
(Added Kotlin) |
|||
Line 689:
===In FORMAT coding===
Within a FORMAT statement various single letters are used to indicate a format code, and these letters have no connection to any variables of that name outside the FORMAT statement. Not all compilers recognise all editing codes as there has been variation, extension, retraction, and standardisation in various directions. A list of such codes is
The basic idea is that the READ or WRITE statement has an I/O list which for output is a sequence of expressions (though usually just the name of a variable), while the input list may only be the names of variables
I9 Integer, width nine. I0 on output means a width sized to suit the numerical value.
L9 Logical, width nine but on output only <code>T</code> or <code>F</code> appears - see below.
F9.3 Floating-point, width nine with three decimal digits after its decimal point.
D9.3 Floating-point double-precision
Q9.3 Floating-point quadruple precision, if available.
E9.3 Floating-point, exponential form, whereby one would appear as <code>0.100E+01</code> (
A9 Character, width nine. Just <code>A</code>
B9 Any type. Transfers binary bits as stored in the variable. Not necessarily its numerical value in binary.
O9 In octal. For floating-point especially the bit pattern will not be that of the value in binary.
Z9 In hexadecimal.
9X Space over nine columns. Alas, 4X3 is not allowed for four advances of three. Only 12X will do.
|