Hello,
>"Aleksandar Donev" <[log in to unmask]> Wrote:
>...
> > 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.
>
At 13:18 18-07-02 -0600, J. Giles wrote as an answer:
>Write (<unit>, '(A)') Str
Well this creates 'X' records (X = size(STR) )
My idea is that A.D. wants all in ONE record.
As he suggested the following is possible (lot of work ??):
Character(32) :: FMT = "(####A)"
write(FMT(2:5), "(I4.4)") X
Write (<unit>, FMT) Str
But with:
FMT = "(9999A)"
it works also, supposing you have at least an idea for the
upper limit of 'X' .
Alternative, maybe more time consuming, use NON advancing output.
Is this of any help ?
--
Met vriendelijke groet,
___ ___
/ \/ / /
__/ /__/
Jan van Oosterwijk
2264 TB Leidschendam
mailto: Jan.vanOosterwijk @ DTO.TUDelft.nl
|