Re: backspace error (reading file from the end)




"leaf" <vuckerster@xxxxxxxxx> wrote in message
news:1154930631.268787.138040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rules and Behavior

Use the BACKSPACE statement with files connected for sequential access.
BACKSPACE cannot be used to skip over records that have been written
using list-directed or namelist formatting.


I have never had a problem with CVF backspacing records from eof position
(file opened with append access at eof)
that were written using list-directed formatting (see below test)

! ------------------------------
program CVF_backspace_test
character(80) :: line
integer :: i(4)

open (1,file='test.dat') ! create file using list i/0
write (1,*) "rec=1",1,11,111
write (1,*) "rec=2",1,2,3,4
write (1,*) "rec=3",3,33333
close (1)

open (1,file='test.dat',position='append')
backspace(1)
backspace(1)
read (1,*) line,i
write (*,91) trim(line),i ! outputs: rec=2 1 2 3 4
91 format (a,4(1x,i0))
end program



.



Relevant Pages

  • Re: Text Formatting in Powerpoint
    ... Now if I can just find a way to move the backspace key to another ... If you place the text cursor to the RIGHT of formatted text, ... type will take on the same formatting as the text preceding it. ... So click to the RIGHT of the letter you want to change, press backspace, ...
    (microsoft.public.powerpoint)
  • Re: backspace error (reading file from the end)
    ... Use the BACKSPACE statement with files connected for sequential access. ... The I/O unit number must specify an open file on disk or magnetic tape. ...
    (comp.lang.fortran)