|Spaces are completely ignored in F77 (and earlier). Columns are significant - specifically col 6. This would be another valid version of the program:
CALLSUBROUTINE(IMPLICIT, LOGICAL, GOTO, IF, INTEGER)
ENDThis is (printable) character by character identical to the first version I presented. I am not 100% sure that F77 allows semicolon to put multiple statements on one line; there is one case of it in the above code, and both the F77 compilers we had access to accepted it. I could have filled up the lines to col.72 to make the code even more compact , but I'll leave that as an exercise for those with extreme tastes in code layout ...
We had denied ourselves the use of literals (but had to lift those restrictions for the strings in the WRITE statements).
lewist57 wrote:2) no DATA statements or other initialization of the varables?
However: F77 specifies that integer values are initialized to zero. Fortran loops are always executed at least once. So INTEGER starts at 0, and when running
DO FOR IF = INTEGER, INTEGER; ENDDOthe loop will increment INTEGER from 0 to 1. Then we create 2 by adding IF + IF, and 13 by INTEGER*INTEGER*INTEGER*INTEGER-INTEGER-IF (i.e. 2*2*2*2 - 2 - 1).
In principle, we could have created ASCII character codes for the string constants in a COMMMON block, and addressed the block alternately as integer or string. That would require knowledge about how a string is laid out in memory, and the code would have to be split in two files (one file can only interpret the common block in a single way). I believe that Hollerith constants are defined to be a plain octet sequence in memory - no descriptor, no terminator - but Hollerith was left out of F77 (and all later versions), wasn't it?
Today, I have forgotten why we have this no-op subroutine named FUNCTION. It could be for some other strange initialization purpose. All I remember is that it had to be there. If I dig up an F77 compiler and debugger, maybe I could tell. My life does not depend on knowing the answer, so I doubt that I will acquire and install an F77 for the sole purpose of finding out