Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!unmvax!brainerd From: brainerd@unmvax.unm.edu (Walt Brainerd) Newsgroups: comp.lang.fortran Subject: Re: Tab characters in output Summary: CHAR is processor dependent Message-ID: <86@unmvax.unm.edu> Date: 12 May 89 22:24:37 GMT References: <3101@lindy.Stanford.EDU> Organization: University of New Mexico at Albuquerque Lines: 25 In article <3101@lindy.Stanford.EDU>, GX.RAR@forsythe.stanford.edu (Buc Richards) writes: > > Can standard fortran output a tab character? The answer is yes, but after reading on, you may think you have asked the wrong question! Usually, being standard means being portable, but there are some exceptions, and this is one of them. The _program_ that does any of these things is standard conforming; it is just not portable (just like a Fortran function with side effects). The reason it is not portable is that the set of characters, other than those given explicitly in the standard (which does _not_ include the tab character), is processor dependent. Thus a tab may be an acceptable character on one machine and not on another. A response indicated that CHAR(9) would do it. This is true only if the machine uses ASCII. The standard says you get character #9, whatever that is, in the collating sequence for your machine. The proposed 8x has two new functions ACHAR and IACHAR, converting from integer to ASCII characters and back. With these ACHAR(9) will be the tab character for sure and this will be portable. Walt Brainerd Unicomp, Inc. 505/275-0800 brainerd@unmvax.unm.edu