This section provides a quick introduction of syntax rules of early versions of FORTRAN language related to punch cards used to store FORTRAN program codes.
Programs written in early versions of FORTRAN language must follow special rules that
were related the punch cards used to store program codes in the early days:
One code line is recorded on one punch card.
A punch card has 80 columns.
Columns from 73 to 80 are used to record a sequence number of each card.
Each card can not record more than 1 statement.
FORTRAN statement code must be written in columns from 7 to 72.
Columns 1 to 5 are used to enter numbers to identify statements
to be referenced in GOTO, DO, READ, and WRITE statements.
Column 6 is used to mark a card to continue a long statement from the previous card.
A letter "C" in column 1 indicates that this card contains a comment, not a FORTRAN statement.
Here is a sample code of an early version of FORTRAN LANGUAGE:
C---- THIS PROGRAM READS INPUT FROM THE CARD READER,
C---- 3 INTEGERS IN EACH CARD, CALCULATE AND OUTPUT
C---- THE SUM OF THEM.
100 READ(5,10) I1, I2, I3
IF (I1.EQ.0 .AND. I2.EQ.0 .AND. I3.EQ.0) GOTO 200
ISUM = I1 + I2 + I3
WRITE(6,20) I1, I2, I3, ISUM
20 FORMAT(7HSUM OF , I5, 2H, , I5, 5H AND , I5,
* 4H IS , I6)
The picture below shows a punch card representing one line of a FORTRAN program