home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #23 / NN_1992_23.iso / spool / vmsnet / misc / 925 < prev    next >
Encoding:
Internet Message Format  |  1992-10-13  |  2.1 KB

  1. Path: sparky!uunet!mcsun!sunic!dkuug!uts!nbivax.nbi.dk!engelhardt
  2. From: engelhardt@nbivax.nbi.dk
  3. Newsgroups: vmsnet.misc
  4. Subject: Re: Output conversion warnings in Vax Fortran
  5. Message-ID: <1992Oct13.092546.1045@nbivax.nbi.dk>
  6. Date: 13 Oct 92 08:25:46 GMT
  7. References: <1992Oct12.112837.18130@monu6.cc.monash.edu.au>
  8. Organization: Niels Bohr Institute and Nordita, Copenhagen
  9. Lines: 50
  10.  
  11. In article <1992Oct12.112837.18130@monu6.cc.monash.edu.au>,
  12. bena@yoyo.cc.monash.edu.au (Ben Aveling) writes:
  13. > I'm sure anyone who has ever used Fortran has seen the ***** type output
  14. > when a number is too big to fit in it's format statement.  My gripe is
  15. > that every time my programs do that, it counts as a warning, and does a
  16. > stack dump.  Can some kind soul please tell me how I can stop this
  17. > happening, short of turning off all messages.
  18. >     Ben
  19.  
  20. Yes, it's a pain isn't it? But you can use LIB$ESTABLISH to get rid of the
  21. messages. Below my signature is a quick and (rather) dirty example that 
  22. should point you in the right direction.
  23.  
  24.         --- Allan
  25.  
  26.  
  27. Allan Engelhardt           | Internet:     Allan.Engelhardt@nbi.dk
  28. Niels Bohr Institute       | HEPnet:       NBIVAX::ENGELHARDT
  29. Blegdamsvej 17             | Bitnet/EARN:  ENGELH at CERNVM
  30. DK-2100 Copenhagen         | Phone direct: (+45)31424284<dial-tone>355
  31. DENMARK                    | Fax:          (+45)31421016
  32.  
  33. ---
  34.       PROGRAM TEST
  35.       REAL R1,R2,R3                 ! These three lines are
  36.       VOLATILE R1,R2,R3             ! used to generate an error
  37.       DATA R2 /1./ , R3 /0./        ! that is not a format error.
  38.       INTEGER*4 HANDLR
  39.       EXTERNAL HANDLR
  40.       CALL LIB$ESTABLISH(HANDLR)    ! This is the trick.
  41.       I = 100
  42.       DO 10 J = 1 , 4
  43.         WRITE(*,1000) I
  44.         I = I*10                    ! J=4 will give a format error.
  45.    10 CONTINUE
  46.       R1=R2/R3                      ! Floating divide zero.
  47.  1000 FORMAT( 1X,'Number is ',I5 )
  48.       END
  49.  
  50.       INTEGER*4 FUNCTION HANDLR(S,M)
  51.       INTEGER*4 S(*),M(5)
  52.       INCLUDE '($SSDEF)'
  53.       IF ( S(2).EQ.1606138 ) THEN   ! I *said* dirty :-}
  54.         HANDLR = SS$_CONTINUE
  55.       ELSE
  56.         HANDLR = SS$_RESIGNAL
  57.       ENDIF
  58.       RETURN
  59.       END
  60.