JoggerRunner
Technical User
Hi ut there,
using the code of Link I want to add strings to an input string, requested by the program. The new strings should be the name of existing data files. But one of them has an extra character at the last position. I can not find out what happens here. Here is a minimal code:
For example, if you type in Ach_40, the output is Ach_40.DOC? and Ach_40.IMG. So, where does the question mark come from?
Thanks a lot
the jogging runner
using the code of Link I want to add strings to an input string, requested by the program. The new strings should be the name of existing data files. But one of them has an extra character at the last position. I can not find out what happens here. Here is a minimal code:
Code:
program test
c
character*8 filin
character*12 dummy,file1,file2
character*4 :: img = '.IMG', doc='.DOC'
integer*4 ls1, ls2, i
c
write(*,*) ' File (ohne Extension): '
read(*,'(a8)') filin
dummy=filin // doc
ls1 = len_trim(dummy)
ls2=0
do i = 1,ls1
if(dummy(i:i).ne.' ') then
ls2=ls2+1
file1(ls2:ls2) = dummy(i:i)
endif
enddo
c zweiter File
dummy=filin // img
ls1 = len_trim(dummy)
ls2=0
do i = 1,ls1
if(dummy(i:i).ne.' ') then
ls2=ls2+1
file2(ls2:ls2) = dummy(i:i)
endif
enddo
write(*,*) file1
write(*,*) file2
stop
end
For example, if you type in Ach_40, the output is Ach_40.DOC? and Ach_40.IMG. So, where does the question mark come from?
Thanks a lot
the jogging runner