Brian Elmegaard wrote, quoting me:
[concerning FORTRAN file structure]
>> as its statement terminator. If you have a statement in your
>> source file, which lacks this terminator, then that statement
>> is invalid -- it violates the language specification.
> Thanks, for the answer, but it is not the fortran files that are
> the problem (sorry for the confusing subject). It is when a
> program compiled with g77 reads text files I have the problem.
Hmm. Yes that is a different question from your original one, at
least as I interpreted it :-)
Unless you're using a fixed record length, random access data model,
FORTRAN uses a line buffered model for input/output, right? That
means every input record *must* be a *line* of text, and a line of
text requires a line break to mark its end. (Try to WRITE a line
of output, as a terminal prompt say, without a following line break,
using *pure* FORTRAN-77; you can't do it, without resorting to
vendor specific, non-standard language extensions. Similarly, a
READ requires a newline character, to tell the I/O subsystem that
the input record is complete).
>> You should use an editor which does the job properly in the
>> first place; my personal choice is vim (or gvim).
> I do. I have tried to save the files with dos, unix, and mac-line
> breaks in emacs.
Have you tried inspecting those files with `od'? Are you *really*
sure that the last line is improperly terminated? Is it possible
that there is a bug in your program, causing it to quit prematurly,
having read the last input line, but not otherwise processed it?
If you are really sure the last line of input is missing its line
break terminator, then read on...
When vim is used to edit text files, it treats them as a collection
of lines of text, each one terminated by a line break. When such a
file is written out to disk, vim guarantees that this terminator
will be preserved on every line, including the last. Surely emacs
should be able to do likewise? If not, perhaps you need to ensure
that the edit buffer includes one additional empty line at the end,
when you write it out; (and by empty, I mean *really* empty -- not
even white space present).