| Thread Tools | Search this thread |
|---|
thomas_boehme
| July 8, 2009 1:14 AM PDT Non expected behavior on deferred length string concatenation when they are fields in a type | ||||
During testing of the new deferred length character strings, I have found another issue related to string concatenation. For "normal" deferred charater strings, the following seems to be allowed and is working fine: A = A // B However, if the string A is not directly declared as character string, but rather contained in a type (see attached code), then the concatenation does not work as expected. In the code example, at the end, I'd expect a string 'abcdef', however, I get '===def' on screen. Is that a issue with the new compiler v11.1 or is a concatenation like that generally not permitted. regards, Thomas PROGRAM STRCAT
TYPE tA
CHARACTER(:),ALLOCATABLE :: Text
END TYPE
CHARACTER(:), ALLOCATABLE :: Str
TYPE (tA) :: A
A%Text = 'abc'
Str = 'def'
A%Text = A%Text // Str
WRITE(*,*) A%Text
END PROGRAM STRCAT
| |||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
| 8442 users have contributed to 31547 threads and 100375 posts to date. |
|---|
| In the past 24 hours, we have 10 new thread(s) 34 new posts(s), and 45 new user(s). In the past 3 days, the most popular thread for everyone has been /fpp interferes with breakpoints/stepping through code - again The most posts were made to Help with hitting maximum record length in the compiler with debug info? The post with the most views is You could save the pre-proce Please welcome our newest member mrnm |