Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!bloom-beacon!think!ames!pasteur!ucbvax!CITHEX.CALTECH.EDU!carl From: carl@CITHEX.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.os.vms Subject: Re: FORTRAN DOUBLE SPACES PRINTED LINES WITH TABS Message-ID: <880320030328.640@CitHex.Caltech.Edu> Date: 20 Mar 88 11:04:30 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 23 > I have a FORTRAN program that opens a text file and prints portions of it > to the screen. It seems that any line which contains a tab is double > spaced by Fortran. If I try to print a portion of a program, which uses > tabs in every line, the complete screen is double spaced, one line of text, > one blank line, etc. Here are the open, print and format statements, > perhaps one of you can tell me what I am doing wrong. > > OPEN(UNIT=1,TYPE='OLD',NAME=FILE,READONLY,CARRIAGECONTROL='LIST') > . > PRINT 20,LINE > 20 FORMAT(1X,A80) > > If one of you could tell me why this inserts a CRLF after any line > containing a tab, I would be much obliged. I can't be sure (you've elided the part of the code that would tell me), but I suspect that you've declared LINE to be CHARACTER*80. If so, that means that your PRINT statement is going to print 80 characters (LINE will have been padded to 80 characters with blanks if the input line was shorter). Since a TAB is a single character, but acts like 8 spaces, you're trying to print something that looks to the terminal like an 87-character line. The line is, therefore, not double-spaced, but wrapped.