Don't forget you can use I2.2 (say) to write 1 or 2 digit integers with any
leading spaces replaced with 0 - doesn't that solve your final query or am I
missing your point?
Peter Jewell
----------------------------------------------------------------------------
----
Mr P.A.Jewell
Computer Officer &
Health and Safety Departmental Liaison Officer
Computer Centre
University of Bradford
BRADFORD
West Yorkshire
BD7 1DP
Phone: 01274 233322
Fax: 01274 304354
email: [log in to unmask]
----------------------------------------------------------------------------
----
On Tuesday, March 09, 1999 9:40 AM, Adriaan Joubert
[SMTP:[log in to unmask]] wrote:
> Andrew Reynolds wrote:
>
> > If anyone knows of a way to force a dynamic format statement I would
> > certainly like to hear about it, and if it doesn't exist then I propose
> > it as a feature for consideration for future versions.
> >
>
> It is quite easy really. You can write the format string into a
> character array and use that. I even use that (through a module for
> outputting 1D and 2D arrays) to dynamically alter the number of decimals
> that are printed. The only problem with constructing a format string is
> that if you use
>
> 8F10.4
>
> in one case and
>
> 10F8.2
>
> in another, then writing the format string becomes awkward, as the first
> has to be written as
>
> write (fmt,'(I1,A,I2,A,I1)') 8,'F',10,'.'4
>
> and in the second case we need
>
>
> write (fmt,'(I2,A,I1,A,I1)') 10,'F',8,'.'4
>
> and I've found no way to write integers without spaces being inserted
> without using an explicit I1, I2 etc. (If somebody has a solution to
> this, please let me know.) So I write the fmt string incrementally.
> Stick it all into a module, overload the functions for different arrays,
> and then that module can also contain all log file administration that
> you need.
>
> Adriaan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|