FORTRAN Reference Manual

Statements
FORTRAN Reference Manual528615-001
7-51
Alphanumeric Editing
The input field consists of optional blanks, optionally followed by a decimal point,
followed by an uppercase T for true or an upper-case F for false (lowercase letters are
invalid). Additional characters (uppercase or lowercase) can follow the T or F. Note that
the logical constants .TRUE. and .FALSE. are valid input forms.
The output field consists of w-1 blanks, followed by the letter T or the letter F,
depending on the logical value of the internal datum.
Alphanumeric Editing
The A descriptor, apostrophe descriptor, and H descriptor control editing of character
data.
The A Descriptor
The A descriptor has the form
A or Aw
It is used with an I/O list item of type character.
On input, if w is greater than the length of the list item, the input quantity is left justified
and stored; FORTRAN fills the remaining character positions with blanks. If
w is less than the length of the item, FORTRAN stores the rightmost characters and
ignores the rest. If you omit w, FORTRAN sets the length of the field equal to the length
of the list item.
On output, if w is less than the length of the list item, the leftmost characters are output.
If w is greater than the length of the list item, the characters are output right justified
and padded with blanks. For example, the following statements
CHARACTER*8 password
password = 'sesame'
WRITE (6,10) password
10 FORMAT(1x,A10)
output the string (circumflexes indicate blanks):
^^
sesame
^^
Note that one leading blank has been consumed for carriage control.
The Apostrophe Descriptor
The apostrophe edit descriptor has the form of a character constant. It causes the
characters (including blanks) within the delimiting apostrophes to be written directly to
the output record from the edit descriptor itself. The width of the field is the number of
characters contained between the delimiting apostrophes. The formatter writes a single
apostrophe to the output device if encounters two adjacent apostrophes within an
apostrophe descriptor.