| 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
| |||||
|
|||||||||||||
|
|||||||||||||
|
|||||||||||||
| 8285 users have contributed to 31229 threads and 99107 posts to date. |
|---|
| In the past 24 hours, we have 9 new thread(s) 39 new posts(s), and 55 new user(s). In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing... Escalated as Please welcome our newest member tvinni |