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 

Warning 298

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



Joined: 09 Jan 2010
Posts: 155
Location: Aalen, Germany

PostPosted: Sun Jul 31, 2016 11:18 am    Post subject: Warning 298 Reply with quote

Code:
    SUBROUTINE TestInquire (NFIL)
    IMPLICIT NONE
    INTEGER, INTENT(IN) :: NFIL
    INTEGER  MXSAL, LP

!!    MXSAL = 0
    INQUIRE (UNIT= NFIL, RECL= MXSAL)

    LP = MXSAL+1
    LP = LP
    RETURN
    END


Why does this code provide
warnig 298 Variable MXSAL has been used without being given an initial value?
If I change UNIT= NFIL against e.g. FILE= 'xx.dat', I get the same warning.
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1683
Location: Yateley, Hants, UK

PostPosted: Sun Jul 31, 2016 4:18 pm    Post subject: Reply with quote

It's because ! signifies 'Comment', and you commented out the assignment statement ...
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 155
Location: Aalen, Germany

PostPosted: Sun Jul 31, 2016 5:36 pm    Post subject: Reply with quote

Litus,

this is unqualified response! MXSAL = 0 should not be necessary.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Mon Aug 01, 2016 6:55 am    Post subject: Reply with quote

It is bug in FTN95 and I have made a note that it needs fixing.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 633

PostPosted: Wed Aug 03, 2016 5:30 am    Post subject: Reply with quote

A 'bug' it may be considered to be, however, it's invariably good practice to initialise ALL variables in a program ... init !!!
Back to top
View user's profile Send private message
EKruck



Joined: 09 Jan 2010
Posts: 155
Location: Aalen, Germany

PostPosted: Wed Aug 03, 2016 7:42 am    Post subject: Reply with quote

John,

in this case the variable MXSAL shoul be initialized by INQUIRE !

Erwin
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Jan 26, 2017 12:13 pm    Post subject: Reply with quote

This has now been fixed for the next release.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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