Aleksandar Donev wrote:
> Hello,
>
> Is there a way to control the way things are justified in a WRITE
> statement. Say I have an I10 format but the integer only has 2
> digits--is it right or left justified and can I change this?
>
> Thanks,
> Aleksandar
Not directly in standard F95 or any current extensions. I have long
wanted a Jx format edit descriptor to do the three common
justifications: Left (JL), Right (JR), and Center (JC).
You can emulate this by writing the number to a character string
variable of suitable length, using ADJUSTR or ADJUSTL, and then writing
the result to the file. Cumbersome but it works.
If you need to do this frequently, you could write one or more
procedures to do the justification.
In F2K, we can streamline this cumbersome process by using
User-Defined Derived-Type Input/Output procedures. However, this
feature will likely be one of the later features to be implemented.
--
Sincerely,
Craig T. Dedo
17130 W. Burleigh Place E-mail: [log in to unmask]
Brookfield, WI 53005-2759 Voice Phone: (262) 783-5869
USA Fax Phone: (262) 783-5928
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin
(1759)
|