Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!husc6!think!ames!pasteur!ucbvax!LBL.GOV!nagy%warner.hepnet From: nagy%warner.hepnet@LBL.GOV (Frank J. Nagy, VAX Wizard & Guru) Newsgroups: comp.os.vms Subject: RE: FORTRAN double spaces printed lines with tabs (on terminal) Message-ID: <880322064319.2d200cd2@LBL.Gov> Date: 22 Mar 88 14:43:19 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 36 > 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 think that what you are seeing is line wrapping. Lines are read from the file into variable line; standard FORTRAN practice pads LINE to 80 characters with blanks. If there are no tabs in LINE, then your PRINT statement will print 81 characters with the first being swallowed for carriage control and the next 80 filling a line on the display. If LINE contains any tabs (and each tab is a single character to the FORTRAN program), then the terminal driver expands the tabs, the end of the line (remember, LINE has a full 80 characters) goes over the right edge of the screen and you get a line wrap (which is a normal setting for terminals). If you do SET TERMINAL/NOWRAP and run your program, the double spacing should disappear. Alternatively, you can modify your program to get the size of LINE as read (see the "Q" format information in the FORTRAN manual - section 12.2.12.1 on page 12-24 of the "Programming in VAX FORTRAN" manual). Then, with the length of LINE in LINELEN, your PRINT and FORMAT statements become: PRINT 20,LINE(1:LINELEN) 20 FORMAT(1X,A) = Frank J. Nagy "VAX Guru & Wizard" = Fermilab Research Division EED/Controls = HEPNET: WARNER::NAGY (43198::NAGY) or FNAL::NAGY (43009::NAGY) = BitNet: NAGY@FNAL = USnail: Fermilab POB 500 MS/220 Batavia, IL 60510