noadv.f
c <html>
c <head><title></title></head>
c <body>
c <pre>
c
program nodav
c
c Demonstration of the Nonoadvance option on READ and WRITE
c
c John Mahaffy 2/24/96
c
implicit none
real a,b,c,d,w,x,y,z
integer lenrec
data w,x,y,z/1.,2.,3.,4./
c
c Begin executable statements
c
write(*,2002,advance='no')
read (*,*) a
write(*,*) 'number =',a
open (11,file='noadv.out')
write(11,*) 'START'
write(11,2000,advance='no') w,x
write(11,2000)y,z
write(11,*) 'DONE'
c<name ="rewind"><font color="FF0000">
rewind(11)
c</font></a>
read(11,*)
c <a name="read"><font color="FF0000">
read(11,2000,advance='no') a,b
c </font></a>
read(11,2000) c,d
print 2001, a,b,c,d
c
c Try a BACKSPACE and read again
c
c<a name="bspace"><font color="FF0000">
backspace (11)
c</a></font>
print *, 'Re-read the record'
read(11,*) a,b,c,d
print 2001, a,b,c,d
stop
2000 format(1x,4f5.1)
2001 format ( ' a = ',f5.1,', b = ',f5.1,', c = ', f5.1,
& ', d = ',f5.1)
2002 format (' Type in a number: ')
end
c </pre>
c </body>
c </html>
c