Hi,
Interesting question.
The attached demo shows four ways of attempting to achieve your
objective (as I understand it). The use of ADVANCE = 'NO' (Method 1 in
the attached) does not work with my usual compiler. It writes each
element of the array in a separate record. The use of the non-standard $
format descriptor does work (Method 2). However, it seems to me that the
extra work required to prepare a format pattern of the form
<ArrayLength><ElementFormat> is trivial (Method 4).
David.
Aleksandar Donev wrote:
>
> Hello,
>
> Another dumb IO question. If I am writing a long character array to a
> file and want to avoid the starting extra blank that would appear with a
> list-directed * formatting, what should I use for the format (I do not
> know the size of the array). I mean, I could make a format string "XA"
> where X=size(character_array), but this seems like it's a lot of work.
> Is there an easier way? I've often used large numbers for X when I don't
> want to count or don't know exactly how many elements there are.
>
> Thanks,
> Aleksandar
|