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 

Error in assigning value to an array section

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

PostPosted: Tue Jul 12, 2022 4:38 am    Post subject: Error in assigning value to an array section Reply with quote

The following test program shows an assignment being made to an array section using a subscript triplet.

Code:
program arraybug
implicit none
logical prms(13)
integer kpm,PrimeNum,Rescnt,maxprms
integer i,j,k
!
prms = .true.
kpm = 12; maxprms=13; Rescnt=8; PrimeNum = 7
i =13; j = maxprms

prms( i:j:PrimeNum*Rescnt) = .false.
print '(13L3)',prms ! prms(13) incorrectly displayed as .T.

k = PrimeNum*Rescnt
prms(i:j:k) = .false.
print '(13L3)',prms ! prms(13) now displayed as .F.

end program


When the third part of the triplet is present as a variable, there is no problem. However, when an expression is used instead for this third part, an error occurs, as the following output (any version of FTN95, with or without /64) shows:

Code:
 
 T  T  T  T  T  T  T  T  T  T  T  T  T                                                                                   
 T  T  T  T  T  T  T  T  T  T  T  T  F
 
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Jul 12, 2022 7:17 am    Post subject: Reply with quote

mecej4

Thank you for the bug report. I have made a note that this needs fixing.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Wed Jul 13, 2022 2:51 pm    Post subject: Reply with quote

This bug has now been fixed for the next release of FNT95.
Back to top
View user's profile Send private message AIM Address
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