When coding in Fortran IV, why are the first eight columns left empty?
-
2When coding in Fortran IV, why are I hope that OP meant When coding in Fortran IV, why were ...– High Performance MarkNov 3, 2016 at 7:51
-
1cant be a very useful code if they are actually all empty.– agentpNov 3, 2016 at 11:31
-
The documentation describes it well stackoverflow.com/documentation/fortran/2103/…– Vladimir F Героям славаNov 3, 2016 at 11:50
-
If you worked with punched cards you should have known anyway.– LilyMNov 3, 2016 at 22:07
-
Some know everything w...s on this site. Not that knowing Fortran is God knows what asset.– LilyMNov 3, 2016 at 22:28
2 Answers
These columns are reserved mainly for three reasons:
a) Column 0 is either blank or contains "c" or "*" when the line will be a comment;
b) Columns 1-5 are used to labels. These labels are used to GOTO instructions; and,
c) The use of column 6 indicates that the line is a continuation of the previous line.
You may see more about this here.
FORTRAN is a fixed-format language - harking back to its origins and punch-cards. This means the position of text on a line conveys meaning.
Typically the first 8 characters are blank. But they can be filled with labels (eg. line numbers) or line continuation markers at specific positions.
So the first eight characters are not always empty. However your code is positioned from column 8 onward so that it is interpreted as instructions (as opposed to labels, etc.)