home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!bnr.co.uk!uknet!mcsun!sunic!aun.uninett.no!nuug!statoil!petek.tek.st.statoil.no!c79057
- From: c79057@petek.tek.st.statoil.no (Joergen Leiknes)
- Newsgroups: comp.lang.fortran
- Subject: How to detect format overflow
- Message-ID: <1992Dec22.140111.5270@statoil.no>
- Date: 22 Dec 92 14:01:11 GMT
- Sender: usenet@statoil.no
- Reply-To: c79057@petek.tek.st.statoil.no (Joergen Leiknes)
- Organization: Statoil
- Lines: 32
- Nntp-Posting-Host: idunn.petek.tek.st.statoil.no
-
- I want to detect overflow in format statements, to avoid to have
- asterisks in the produced output. (Yes,I know that it is possible
- to have larger fields for each variable, but it would be nice to
- have an error jump when such things occur)
-
- In the little test program below:
- PROGRAM IOTEST
- INTEGER ISTAT, I
- REAL X
- X = 123123.3
- I = -123123
- WRITE(*,700,ERR=900, IOSTAT= ISTAT) X, I
- 700 FORMAT(' X is ',F6.3,' I is ',I6)
- GOTO 999
-
- 900 CONTINUE
- WRITE(*,*) ' IOERROR no. ', ISTAT
- GOTO 999
-
- 999 CONTINUE
- END
-
- Gives this output:
- X is ****** I is ******
-
- and no error is catched.
-
- I would like to know if it is possible according to f77 or f90 standard
- to catch such overflows.
-
- Thanks in advance
- Jorgen Leiknes, Statoil NORWAY
-