Reputation: 33
I recently inherited a legacy Windows binary and its source code, which is apparently written in Fortran(the language I am not familiar with). Trying to understand how it's working, I peeked into the source code and this syntax just caught my eyes:
DIMENSION X(10) ABC02340
C ABC02350
X(1)=9.876543D-2 ABC02360
X(2)=1.234567D-1 ABC02370
X(3)=2.587539D-0 ABC02380
X(4)=6.549873D-0 ABC02390
...
(The example code above is tweaked a bit for the sake of confidentiality)
Most of the lines of the source code had 8-letter "suffixes" that consists of:
They are (mostly) perfectly aligned vertically, occupying 73rd-80th characters of most of the lines. Some of them are commented out along with code. I even found some that are adjacent to closing brackets without a single space.
What is strange is that, I have yet to find a code example of Fortran with this "suffix". I tried searching some keywords such as "suffix", "label", "row number" or "end of line" but no avail. So far I figured out that they are neither comments, nor labels for GOTO statements.
Question: What are those "suffixes"? What is the name of this syntax? Or is this just a habit of original developer with some pre-compile macro involved?
Upvotes: 3
Views: 159
Reputation: 14967
This is a sequence number and is rarely used today for obvious reasons:
It was not uncommon for the programmer or the operator of the card reader to drop some or all of the cards on the floor, which usually put them out of order. The only insurance against this disaster was to punch a sequence number in columns 73-80 of each card, so that if they got scrambled they could ... be put back in order using a mechanical card sorter.
Classical Fortran
When using fixed format, only the first 72 columns of each line are scanned.
Upvotes: 6