Problem: “Error with Character Variable is not reported”
This is only a minor “problem”: The handbook says that the use of a character variable on both sides of an assignment statement is not permitted. As the test program shows, this is not detected or reported by /Checkmate.
However, it seems to me that the above statement is not fully correct since a –meaningful- assignment of the form
Character_Variable (i:j) = Character_Variable (k:l)
should be (and is) treated correctly.
Klaus Lassmann
Winapp
Program Test
Implicit None
Integer :: i
Character (len = 1), Dimension (3) :: Text
Character (len = 3) :: Text_all
Text (1) = 'A'
Text (2) = 'B'
Text (3) = 'C'
Text_all = ''
Do i = 1,3
Text_all = Text_all // Text (i) ! not allowed, but not reported
End Do
write (*,*) 'Text_all =', Text_all ! Result wrong
Do i = 1,3
Text_all (i:i) = Text (i)
End Do
write (*,*) 'Text_all =', Text_all ! Result correct
Text_all (1:2) = Text_all (2:3) ! assignement statement
write (*,*) 'Text_all =', Text_all ! Result correct
Text (1) = 'a'
Text (2) = 'b'
Text (3) = 'c'
Text_all (1:1) = Text (1)
Do i = 2,3
Text_all (1:i) = Text_all (1:i-1) // Text (i) ! allowed ???
End Do
write (*,*) 'Text_all =', Text_all ! Result correct
End Program Test
del comp.lis
del *.obj
del *.exe
ftn95 Test.f95 /checkmate /link >> comp.lis
sdbg Test.exe