[comp.lang.fortran] VAX/SGI -> IBM RISC/6000 source format problem with FORTRAN code

hoberoi@eagle.wesleyan.edu (10/19/90)

I am porting several programs that compile on SGI and vaxen to the IBM
RISC/6000.

problem : the source is tab delimited and extends over 72 columns and will
therefore not be accepted by xlf. Replacing tabs with spaces will not work as,
the fixed format for xlf will ignore colums beyond 72. Free format source on 
the otherhand requires a "-"(!!) at end of line for long lines and will not 
accept either the tab delimited stuff or continuation lines (ie column 6 etc ).

anyone worked this out ?!!

himansu.

PS: WHY use a confusing "-" sign to indicate a continuation line a "\" would
have been more appropriate here.

alex@am.sublink.org (Alex Martelli) (10/21/90)

In <1990Oct18.140659.34573@eagle.wesleyan.edu> hoberoi@eagle.wesleyan.edu writes:
	...
>problem : the source is tab delimited and extends over 72 columns and will
>therefore not be accepted by xlf. Replacing tabs with spaces will not work as,
>the fixed format for xlf will ignore colums beyond 72. Free format source on 

I believe xlf has an option to set the linelength it will accept to
something else than 72.  Anyway it should be pretty easy to define
a source-to-source transformation, say by piping the tab-expanded
source into awk running something like (NOT tested):

length($0)>72 { print substr($0,1,72);
				print "     ." substr($0,73)
			  }
(if all length are no more than 138, with obvious extensions to more
continuation-lines if needed).
-- 

Alex Martelli - (home snailmail:) v. Barontini 27, 40138 Bologna, ITALIA
Email: (work:) staff@cadlab.sublink.org, (home:) alex@am.sublink.org
Phone: (work:) ++39 (51) 371099, (home:) ++39 (51) 250434;