arjenmarkus / old-programming-idioms

Explain old-style programming idioms used in FORTRAN 77 programs
MIT License
18 stars 3 forks source link

Clarify meaning of special columns (1-6) in fixed form. #3

Closed everythingfunctional closed 1 year ago

everythingfunctional commented 1 year ago

I think this more accurately reflects the behavior. I've never heard that 0 isn't allowed as the continuation character. If it's true I'll add it back in.

gklimowicz commented 1 year ago

Just FYI: From Fortran 2018 standard: "6.3.3.3 Fixed form statement continuation Except within commentary, character position 6 is used to indicate continuation. If character position 6 contains a blank or zero, the line is the initial line of a new statement, which begins in character position 7. If character position 6 contains any character other than blank or zero, character positions 7–72 of the line constitute a continuation of the preceding noncomment line."

gklimowicz commented 1 year ago

And I have no idea why "0" is treated like blank, but it's been that way since Fortran I in 1956. "For each statement the initial card must contain either a zero or a blank in column 6; on continuation cards column 6 must not contain a zero or a blank, and it should be used to number the continuation cards consecutively from 1 to 9."

arjenmarkus commented 1 year ago

Okay, I reviewed the changes. They look fine (except for a minor typo).