Silverfrost Forums

Welcome to our forums

Latest FTN95 does not accept * as format repetition count

5 Dec 2025 3:09 #32518

Given the following program:

program testg0
implicit none
character(*), parameter :: cfmt = '(*(g0,1x))'
integer :: i,j,k
i=2; j=3; k=i*j
print cfmt,i,j,k
end program testg0

the compiler says:

S:\>ftn95 /check tg0.f90 /link
[FTN95/Win32 Ver. 9.14.0 Copyright (c) Silverfrost Ltd 1993-2025]
ERROR S:\tg0.F90 6:  Unknown edit descriptor '*', or missing comma
    1 ERROR  [<TESTG0> FTN95 v9.14.0]
*** Compilation failed

GFortran 11.4 accepts the code, and running the program produces the output

2 3 6
5 Dec 2025 7:28 #32519

mecej4

Thank you for the feedback. I will add this to the list as a missing feature.

It looks like this has never been implemented in FTN77 and FTN95.

Off hand I don't know when it was added to the Fortran Standard.

5 Dec 2025 8:56 #32520

Thanks, Paul. The use of '*' as a repeat count for format items was introduced in F2008. There is a description of the feature at https://stevelionel.com/drfortran/2009/07/01/doctor-fortran-in-revert-revert-the-end-of-the-format-is-nigh/ .

I was unaware of this new language feature, too, before its appearance in a code snippet posted by someone in a Fortran users group caught my attention.

5 Dec 2025 10:43 #32521

This has now been implemented for the next release of FTN95.

5 Dec 2025 1:55 #32522

This is a great addition! The link describes this all so well!

Please login to reply.