home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
- From: jlg@cochiti.lanl.gov (Jim Giles)
- Newsgroups: comp.lang.fortran
- Subject: Re: Variable repeat count specifier for FORMAT statments
- Message-ID: <1992Jul24.152129.16299@newshost.lanl.gov>
- Date: 24 Jul 92 15:21:29 GMT
- References: <1992Jul23.215113.16531@jhunix.hcf.jhu.edu> <1992Jul24.012058.21162@ncsa.uiuc.edu>
- Sender: news@newshost.lanl.gov
- Distribution: na
- Organization: Los Alamos National Laboratory
- Lines: 23
-
- In article <1992Jul24.012058.21162@ncsa.uiuc.edu>, hirchert@ncsa.uiuc.edu (Kurt Hirchert) writes:
-
- |> [...] In more complex
- |> situations, I would build the format on the fly:
- |>
- |> character*80 fmt
- |> ...
- |> write (fmt,'(a,i3,a)') '(',n,'(I8))'
- |> write (*,fmt) whatever_it_is_you_wanted_to_write
-
- Wouldn't it be more legible to write:
-
- character*80 fmt
- ...
- fmt='(nnn(I8))'
- write (fmt(2:4),'(I3)') n
- write (*,fmt) whatever_it_is_you_wanted_to_write
-
- There is no need to construct the entire value of `fmt' with the internal
- write, you need only concern yourself with that part which changes.
-
- --
- J. Giles
-