xref: /original-bsd/usr.bin/f77/libI77/test/ioitst.f (revision a1c2194a)
1C
2C Copyright (c) 1980 The Regents of the University of California.
3C All rights reserved.
4C
5C %sccs.include.proprietary.f%
6C
7C	@(#)ioitst.f	5.2 (Berkeley) 04/12/91
8C
9
10	program ioitst
11
12	character*80 buf
13	logical ioinit, iok, ictl, izro, iap
14	integer ftell
15	external ioinit, ftell
16
17	if (iargc() .ge. 1) then
18		call getarg(1, buf)
19		ictl = (buf(1:1) .eq. 'T')
20	else
21		ictl = .true.
22	endif
23
24	if (iargc() .ge. 2) then
25		call getarg(2, buf)
26		izro = (buf(1:1) .eq. 'T')
27	else
28		izro = .false.
29	endif
30
31	if (iargc() .ge. 3) then
32		call getarg(3, buf)
33		iap = (buf(1:1) .eq. 'T')
34	else
35		iap = .false.
36	endif
37
38	iok = ioinit(ictl, izro, iap, "FORT", .true.)
39	write(*,*) "ioinit returned", iok, "pos", ftell(10)
40
41   10	read(10,"(i3,a)",end=999) line, buf
42	write(6, "('0',i3,a)") line, buf(:lnblnk(buf))
43	goto 10
44
45  999	write(6, "(f6.2)") 0.0
46	end
47