This is the simplest form of directing unformatted data to the standard output channel, for example,
PROGRAM Outie CHARACTER(LEN=*), PARAMETER :: long_name = & "Llanfairphwyll...gogogoch" REAL :: x, y, z LOGICAL :: lacigol x = 1; y = 2; z = 3 lacigol = (y .eq. x) PRINT*, long_name PRINT*, "Spock says ""illogical& &Captain"" " PRINT*, "X = ",x," Y = ",y," Z = ",z PRINT*, "Logical val: ",lacigol END PROGRAM Outie
produces on the screen,
Llanfairphwyll...gogogoch Spock says "illogical Captain" X = 1.000 Y = 2.000 Z = 3.000 Logical val: F
Return to corresponding overview page
As can be seen from the above example, the PRINT statement takes a comma separated list of things to print, the list can be any printable object including user-defined types (as long as they don't contain pointers). The * indicates the output is in free (default) format. Fortran 90 supports a great wealth of output (and input) formatting which is not all described here!
There are a couple of points to raise,
lacigol = (y .eq. x)
generates an F signifying .FALSE..
PRINT*, "Spock says ""illogical& &Captain"" "
If a CHARACTER string crosses a line indentation can still be used if an & is appended to the end of the first line and the position from where the string is wanted to begin on the second - see the Spock line in the example; the & s act like a single space.
PRINT*, 'Spock says "illogical& &Captain" '
In this case the (unsued ") delimiter does not have to be escaped.