🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.misc
Article #159

Re: Output conversion warnings in Vax Fortran

#159
From: engelhardt
Date: Tue, 13 Oct 1992 08:25
50 lines
2247 bytes
In article <1992Oct12.112837.18130@monu6.cc.monash.edu.au>,
bena@yoyo.cc.monash.edu.au (Ben Aveling) writes:
> I'm sure anyone who has ever used Fortran has seen the ***** type output
> when a number is too big to fit in it's format statement.  My gripe is
> that every time my programs do that, it counts as a warning, and does a
> stack dump.  Can some kind soul please tell me how I can stop this
> happening, short of turning off all messages.
> 
> 	Ben

Yes, it's a pain isn't it? But you can use LIB$ESTABLISH to get rid of the
messages. Below my signature is a quick and (rather) dirty example that 
should point you in the right direction.

        --- Allan


Allan Engelhardt           | Internet:     Allan.Engelhardt@nbi.dk
Niels Bohr Institute       | HEPnet:       NBIVAX::ENGELHARDT
Blegdamsvej 17             | Bitnet/EARN:  ENGELH at CERNVM
DK-2100 Copenhagen         | Phone direct: (+45)31424284<dial-tone>355
DENMARK                    | Fax:          (+45)31421016

---
      PROGRAM TEST
      REAL R1,R2,R3                 ! These three lines are
      VOLATILE R1,R2,R3             ! used to generate an error
      DATA R2 /1./ , R3 /0./        ! that is not a format error.
      INTEGER*4 HANDLR
      EXTERNAL HANDLR
      CALL LIB$ESTABLISH(HANDLR)    ! This is the trick.
      I = 100
      DO 10 J = 1 , 4
        WRITE(*,1000) I
        I = I*10                    ! J=4 will give a format error.
   10 CONTINUE
      R1=R2/R3                      ! Floating divide zero.
 1000 FORMAT( 1X,'Number is ',I5 )
      END

      INTEGER*4 FUNCTION HANDLR(S,M)
      INTEGER*4 S(*),M(5)
      INCLUDE '($SSDEF)'
      IF ( S(2).EQ.1606138 ) THEN   ! I *said* dirty :-}
        HANDLR = SS$_CONTINUE
      ELSE
        HANDLR = SS$_RESIGNAL
      ENDIF
      RETURN
      END
Technical Details
Message-ID: <1992Oct13.092546.1045@nbivax.nbi.dk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!dkuug!uts!nbivax.nbi.dk!engelhardt
References: <1992Oct12.112837.18130@monu6.cc.monash.edu.au>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!dkuug!uts!nbivax.nbi.dk!engelhardt
From: engelhardt@nbivax.nbi.dk
Newsgroups: vmsnet.misc
Subject: Re: Output conversion warnings in Vax Fortran
Message-ID: <1992Oct13.092546.1045@nbivax.nbi.dk>
Date: 13 Oct 92 08:25:46 GMT
References: <1992Oct12.112837.18130@monu6.cc.monash.edu.au>
Organization: Niels Bohr Institute and Nordita, Copenhagen
Lines: 50