Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!lll-winken!aunro!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.fortran Subject: Re: Left justify of integers. Message-ID: Date: 2 Jun 91 19:41:50 GMT References: <1991Jun1.043052.29008@jato.jpl.nasa.gov> Organization: MTS Univ of Alberta Lines: 41 In article <1991Jun1.043052.29008@jato.jpl.nasa.gov>, vsnyder@jato.jpl.nasa.gov (Van Snyder) writes: >In article quan@sol.surv.utas.edu.au (Stephen Quan) writes: >>I'm having a slight, almost trivial problem, I cannot write >>integers without them being right justified. >> >>eg write (*,*) 5 >> >> gives >> >> ......5 (. are leading spaces) >> >> >>Is there some format statement (i1.1 or something) that will >>solve this problem? I want a general solution, not just : >> >> write (*,'(i1)') 5 >> >It was for exactly this reason that I urged X3J3, during all the public >reviews, to generalize format specifications so that the "w" part was >optional, as it is in "a" formats. The committee responded that the >standard ALLOWS an implementor to do just this with * format. But it's >hard to mix * with precise fixed formats, and, in addition, few if any >vendors left justify numbers in * format. > The same position was urged by Bert Buckley of the Fortran Working Group of the Canadian Standards Association, unfortunately with the same (lack of) success. I suggested a new pair of edit specifiers, to operate similarly to BN and BZ, which would optionally reduce all groups of blanks to a single blank on output, regardless of the source of the blank (i.e. format string literal, string constant or variable, or leading blanks in a numeric field). Seems odd that such simple everyday useful things would be left changes to the language. out, while they did deal with much more complex and contentious -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | Disclaimer: "not much better than CANADA | datclaimer" -------------------+-------------------------------------------