forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Latest FTN95 does not accept * as format repetition count

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
mecej4



Joined: 31 Oct 2006
Posts: 1929

PostPosted: Fri Dec 05, 2025 4:09 am    Post subject: Latest FTN95 does not accept * as format repetition count Reply with quote

Given the following program:
Code:

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:
Code:

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
Code:

2 3 6
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8307
Location: Salford, UK

PostPosted: Fri Dec 05, 2025 8:28 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1929

PostPosted: Fri Dec 05, 2025 9:56 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8307
Location: Salford, UK

PostPosted: Fri Dec 05, 2025 11:43 am    Post subject: Reply with quote

This has now been implemented for the next release of FTN95.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1275
Location: Morrison, CO, USA

PostPosted: Fri Dec 05, 2025 2:55 pm    Post subject: Reply with quote

This is a great addition! The link describes this all so well!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group