For READ and WRITE statements.
"If an input item or an output item is allocatable, it shall be allocated.”
which would contradict the idea of reallocation, since it also applies to unallocated objects.
In the section on character input formatting for list-directed input:
"Let len be the length of the next eective item, and let w be the length of the character sequence. If len is less than or equal to w, the leftmost len characters of the sequence are transmitted to the next eective item. If len is greater than w, the sequence is transmitted to the leftmost w characters of the next eective item and the remaining len≠w characters of the next eective item are filled with blanks. The effect is as though the sequence were assigned to the next eective item in an intrinsic assignment statement (7.2.1.3).”
Up until the last sentence, it is clearly consistent with Harvey’s analysis. I think that updating the last sentence above might have been overlooked when auto-reallocating characters with different lengths was added. It currently is not consistent with the rest of the paragraph. And hence a potential source of confusion.
Cheers,
Bill
On Apr 13, 2016, at 6:09 AM, Anton Shterenlikht <[log in to unmask]> wrote:
>> I think you provided an allocated variable to be read into and
>> because it was zero length no data was transferred.
>
> I expected the variable to be reallocated
> with the length equal to the length of the
> input string.
>
>>> I cannot see from 7.2.1.2 or 7.2.1.3
>>> whether reading character variable
>>> from input_unit is an intrinsic assignment or not?
>>
>> Seems quite clear to me (quote is not from the version you quoted)
>> "An intrinsic assignment statement is an assignment statement..."
>
> So reading from input_unit is not an assignment?
> You said "transferred" above.
>
> Anton
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101
|