Index: gfortran.texi =================================================================== --- gfortran.texi (revision 147057) +++ gfortran.texi (working copy) @@ -1641,7 +1641,7 @@ * STRUCTURE and RECORD:: @c * UNION and MAP:: * ENCODE and DECODE statements:: -@c * Expressions in FORMAT statements:: +* Variable FORMAT expressions:: @c * Q edit descriptor:: @c * AUTOMATIC statement:: @c * TYPE and ACCEPT I/O Statements:: @@ -1779,6 +1779,41 @@ @end smallexample +@node Variable FORMAT expressions +@subsection Variable @code{FORMAT} expressions +@cindex @code{FORMAT} + +A variable @code{FORMAT} expression is format statement which includes +angle brackets enclosing a Fortran expression: @code{FORMAT(I)}. GNU +Fortran does not support this legacy extension. The effect of variable +format expressions can be reproduced by using the more powerful (and +standard) combination of internal output and string formats. For example, +replace a code fragment like this: + +@smallexample + WRITE(6,20) INT1 + 20 FORMAT(I) +@end smallexample + +@noindent +with the following: + +@smallexample + WRITE(F,'("(I", I0.5, ")")') N+1 + WRITE(6,F) INT1 +@end smallexample + +@noindent +or with: + +@smallexample + WRITE(F,*) N+1 + WRITE(6,"(I" // ADJUSTL(F) // ")") INT1 +@end smallexample + + + + @c --------------------------------------------------------------------- @c Intrinsic Procedures @c ---------------------------------------------------------------------