Re: Substring in DATA implied-do

"Dick Hendrickson" <dick.hendrickson@xxxxxxx> wrote in message
John Harper wrote:
I think both the f95 and f2003 standards forbid a program beginning thus:

CHARACTER string*1025
DATA (string(i:i),i=1,1025)/1025*'?'/

but allow one to begin thus:

TYPE longstr
CHARACTER string*1025
END TYPE longstr
DATA (example%string(i:i),i=1,1025)/1025*'?'/

because f95 section 5.2.10 R536 and f2003 section 5.2.5 R528 both say
data-i-do-object is array-element
or scalar-structure-component
or data-implied-do

Three f95 compilers (NAG, Sun, g95) agree with me, but was there a good
reason for J3 to allow a substring in a data-implied-do only if it's a
structure component?
Interesting that the compilers agree with you. The F2003 standard has
a constraint
"C560 (R528) The scalar-structure-component shall contain at least one
part-ref that contains a subscript-list."

I'd have to look more, but I'd think that makes your last example
wrong, since there's no subscript list. When you tried this, did
you have all of the non-standard warnings enabled?
This looks like something lifted directly from the standard. What do the
C560 and the R528 refer to? LS