Silverfrost Forums

Welcome to our forums

Warning 298

31 Jul 2016 10:18 #17859
    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.

31 Jul 2016 3:18 #17860

It's because ! signifies 'Comment', and you commented out the assignment statement ...

31 Jul 2016 4:36 #17861

Litus,

this is unqualified response! MXSAL = 0 should not be necessary.

1 Aug 2016 5:55 #17863

It is bug in FTN95 and I have made a note that it needs fixing.

3 Aug 2016 6:42 #17871

John,

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

Erwin

26 Jan 2017 11:13 #18772

This has now been fixed for the next release.

Please login to reply.