home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!hirchert
- From: hirchert@ncsa.uiuc.edu (Kurt Hirchert)
- Subject: Re: Variable repeat count specifier for FORMAT statments
- References: <1992Jul23.215113.16531@jhunix.hcf.jhu.edu> <1992Jul24.012058.21162@ncsa.uiuc.edu> <1992Jul24.152129.16299@newshost.lanl.gov>
- Message-ID: <1992Jul26.034105.28542@ncsa.uiuc.edu>
- Originator: hirchert@harriett.ncsa.uiuc.edu
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: Nat'l Ctr for Supercomp App (NCSA) @ University of Illinois
- Distribution: na
- Date: Sun, 26 Jul 1992 03:41:05 GMT
- Lines: 32
-
- In article <1992Jul24.152129.16299@newshost.lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes:
- |>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.
-
- I guess this is a matter of taste. I don't like the idea of having to
- figure out the exact character positions I want to modify (not difficult
- in this case, but it could be in a more complex format), and I like even
- less the idea of maintaining this position information each time the
- format is altered.
-
- I also prefer using only two statements.
- --
- Kurt W. Hirchert hirchert@ncsa.uiuc.edu
- National Center for Supercomputing Applications
-