19 character(len=:),
allocatable :: path
51 TYPE(
file),
INTENT(in) :: theFile
52 INTEGER,
INTENT(out) :: err
54 open(action=
'read',
file=thefile%path, unit=thefile%unit, iostat=err)
74 TYPE(
file),
INTENT(in) :: theFile
75 INTEGER,
INTENT(out) :: err
77 open(action=
'write',
file=thefile%path, unit=thefile%unit,status=
"replace", iostat=err)
99 TYPE(
file),
INTENT(in) :: theFile
114 TYPE(
file),
INTENT(in) :: theFile
116 open(unit=thefile%unit, iostat=err,
file=thefile%path, status=
'old')
117 if (err == 0)
close(thefile%unit, status=
'delete')
143 TYPE(
file),
INTENT(in) :: theFile
144 INTEGER,
INTENT(in) :: n
145 character(len=:),
allocatable,
INTENT(out) :: word
146 character(len=:),
allocatable,
INTENT(out) :: rest
147 INTEGER,
INTENT(out) :: err
148 character(len=1024) :: buffer
149 INTEGER startPos, endPos, i, j
156 do while(j < len(buffer) .and. buffer(j:j) ==
" ")
159 endpos = j+index(buffer(j:len(buffer)),
" ")-2
164 word = buffer(startpos:endpos)
165 rest = trim(buffer(endpos+1:len(buffer)))
192 TYPE(
file),
INTENT(in) :: theFile
193 INTEGER,
INTENT(out) :: nwords
194 character(len=30) ,
INTENT(out) :: words (1:50)
195 character(len=:),
INTENT(out),
allocatable :: rest
196 INTEGER,
INTENT(out) :: err
197 character(len=1024) :: buffer
198 character(len=:),
allocatable :: word
199 INTEGER startPos, endPos, j
207 do while(nwords <= 50 .and. len(rest) > 0 .and. word /=
"!")
209 do while(j < len(buffer) .and. buffer(j:j) ==
" ")
212 endpos = j+index(buffer(j:len(buffer)),
" ")-2
215 word = buffer(startpos:endpos)
218 rest = trim(buffer(endpos :len(buffer)))
221 rest = trim(buffer(endpos+1:len(buffer)))
subroutine extractword(thefile, n, word, rest, err)
extractWord
character(2) relativepathletter
subroutine closefile(thefile)
closeFile
subroutine openfiler(thefile, err)
openFileR
character(len=1), parameter format_character
character(len=5), parameter format_real
character(len=2), parameter format_logical
character(len=3), parameter format_integer
subroutine extractandcountwords(thefile, nwords, words, rest, err)
ExtractAndCountWords
subroutine openfilew(thefile, err)
openFileW
subroutine deletefile(thefile)
deleteFile