I am trying to compile a old Fortran application, original written for Microsoft Fortran (v3.3 1985, F77) using GNU Fortran.
The bigger question: What is the easiest way to compile a Microsoft Fortran DOS application compiling to a binary for Windows?
I get a large number of errors if I try to compile this code using f77, mainly in printing output (to screen/file). How can I fix?
110 FORMAT(/,10X,' Enter action : '\)
1
Error: Unexpected element ‘\’ in format string at (1)
APP1.FOR:107:20:
120 WRITE(*,'(1X,2A\)')CH,'[2J'
1
Error: Unexpected element ‘\’ in format string at (1)
APP1.FOR:121:44:
What is the syntax of WRITE?
120 WRITE(*,100)
1
Error: FORMAT label 100 at (1) not defined
\in a format string is a non-standard extension supported by some compilers that suppresses a newline after the output (so reading input happens on the same line as the prompt). There is no equivalent in standard Fortran 77. The syntaxWRITE(*,100)is valid, but for it to work, there needs to be a format statement with label100in the same subprogram (akin to the format110you have shown). The compiler is telling you there is no such format statement in that sub-program.