The PRINT procedure is used to output numbers in a simple, rigid manner. A PRINT statement has the form
where list is described above. An example of a PRINT statement is
A PRINT statement always puts out at least one line printer image. A line may contain up to 6 numbers, each of which is in scientific notation with 10 decimal places. Each number is right-justified in a field of 20 columns. (The format is 6E20.10.) The above PRINT statement will output two numbers in the first forty spaces, and the rest of the line will be blank. A PRINT statement such as
PRINT (for I := 1 step 1 until 10 do A[I])
will output one line of 6 numbers followed by one line of 4 numbers. Single spacing between lines is automatic.
The PRINT procedure always outputs on the standard output medium.
The WRITE procedure is used to output strings. Examples of WRITE statements are:
WRITE (if D < 0 then 'TRUE' else 'FALSE') .
Each parameter must be a string expression (see Appendix A for definition of string expression). There may be any number of parameters, but each string will appear on a separate line. If a string is too long to go on one line, it will be continued on the next line. A string should not contain another string. Lines are single spaced. Each WRITE statement causes at least one line printer image to be put out.
The WRITE procedure always outputs on the standard output medium.
The PUNCH procedure is used to output numbers on punched cards in a form which can be input by the READ procedure. Each number punched will be followed by a comma. Each card punched may contain up to four numbers. Each number will be of type real, but since the READ procedure makes any necessary type conversions this is unimportant. A PUNCH statement has the same form as a PRINT statement. Each PUNCH statement causes at least one card image to be put out.
The PUNCH procedure always outputs on the standard punch medium.
The two input and output procedures remaining to be described make use of formats. The formats are exactly those used in Fortran, and readers unfamiliar with Fortran will find it necessary to refer to the Control Data Fortran-62 Reference Manual for details on the use of formats.
A format is treated as a string. Formats will be written, for example, as follows: