Hollerith fields in Format statements are 'deleted' in Fortran 95, but Fortran compilers continue it to support it. While working with an old Fortran program with copious instances of Format statements with Hollerith edit descriptors, I discovered a perplexing bug in FTN95 8.63. Here is a bug demonstrator, in fixed form source:
C
PROGRAM HOLLERITH_BUG
* 1 2 3 4 5 6 7
*23456789 123456789 123456789 123456789 123456789 123456789 123456789 12XXXXXXXX
WRITE (*,10)
10 FORMAT (//,2X,39HWARNING: 1) Hollerith fields in Format ,
+ 29Hspecifications can cause bugs,/,22X,23Has you will see in this
+ ,9H example.)
WRITE (*,20)
20 FORMAT (9X,49H2) Especially problematic are circumstances such
2 ,37Has this example with two such formats)
WRITE (*,*)
END
The compiler says:
[FTN95/Win32 Ver. 8.63.0 Copyright (c) Silverfrost Ltd 1993-2020]
0009) WRITE (*,20)
*** Continuation of Hollerith strings is not supported
1 ERROR [hbug.F] - Compilation failed.
The wording of the error message suggests that the compiler objects to one of the two FORMAT statements rather than the WRITE statement. After trying several changes to the two FORMAT statements, I found that what may be happening is as follows.
Line 10 contains a Hollerith descriptor of stated length 49. That implies that the line should contain a space character at the end of the line before EOL. However, most text editors remove trailing spaces from program source lines, and Fortran compilers pad fixed form source line ends with blanks. FTN95 does not appear to do so, and in most circumstances it would not matter, but not here. It probably finds only 48 characters before EOL, and issues the error message. To test this, I placed a character in column 73 of that line, and that made the error message go away.