Well...Got new problem with the tabs.
When i try to find the position of TAB in the text string using INDEX, i get wrong result.
To reproduce this, one can use same demo code as above, modified a bit to include read_tabs@. Code just reads and writes line of text from one file into another. And is doing that so that both a.ini and b.out files are identical.
Wrong becomes the text manipulation with the strings which have tabs.
If the file a.ini consists of arbitrary text and one or several tabs, the INDEX, which must bring us position of the first tab iPosOfTab, produces something else which depends of the entire text of the line. Is this 'gray area' of the Fortran standard or just the bug?
From the other hand, if we remove read_tabs@ (and lose the ability to write exactly the same line back to the file b.out) the INDEX works fine, it finds position of the TAB correctly. The miracle is that TAB is destroyed being substituted with spaces but actually it is not until the text is written to the file. Very hidden mechanics...
CHARACTER*128 text
open(111,file='a.ini')
call READ_TABS@(111)
open(112,file='b.out')
read (111,'(a)',end=1000) TEXT
write(112,'(a)') TRIM(TEXT)
1000 close(111)
close(112)
iPosOfTab = index(text,' ')
print*, iPosOfTab
end