When you want to write
values in a pattern on the output lines, use format lists to shorten
your coding time. A format list consists of the corresponding formats
separated by either blanks or commas and enclosed in parentheses.
It must follow the names of the variables enclosed in parentheses.
For example, this statement
uses a format list to write the five variables SCORE1 through SCORE5,
one after another, using four columns for each value with no blanks
in between:
put (score1-score5) (4. 4. 4. 4. 4.);
A shorter version of
the previous statement is
put (score1-score5) (4.);
You can include any
of the pointer controls (@, #, /, +, and OVERPRINT) in the list of
formats, as well as
n*, and
a character string. You can use as many format lists as necessary
in a PUT statement, but do not nest the format lists. After all the
values in the variable list are written, the PUT statement ignores
any directions that remain in the format list.
For an example,
see Including More Format Specifications than Necessary.
You can also specify
a reference to all elements in an array as (
array-name {*}),
followed by a list of formats. You cannot, however, specify the elements
in a _TEMPORARY_ array in this way. This PUT statement specifies an
array name and a format list:
put (array1{*}) (4.);
For more
information about how to reference an array, see Arrays.