Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Indenting existing free form file

cacciatore
Beginner
1,027 Views
Hi,
I transformed some old fixed form source files to free form using John Burkardt Fixcon program. As I used TAB to indentsome lines ( not a 'whise' choice according to Mr Burkardt ), the resulting free form file is ugly indented.
I tryied other transforming programs but Fixcon gave best results and is easyer to use.
Does anyone knows of a programthatdoes a niceindent on existing free form source files ?
As forDelphi there is a source formatting tool (DelForExp),I hope there is also one for Fortran.
Thanks for any help.
Geraldo
0 Kudos
5 Replies
Jugoslav_Dujic
Valued Contributor II
1,027 Views
Why don't you just remove tabs from the originals and redo the conversion? There's an option Edit/Advanced/Untabify selection in VS (or somewhere near) -- just repeat it for all original files and you'll get tab-free files to start with.
0 Kudos
cacciatore
Beginner
1,027 Views

Hi Jugoslav,

After posting my message I did what you are just suggesting. The result was better looking, but the real culprit was myoriginal fixed formbad indenting. I had to reindent everything again. In Dev Studio there is a 'Smart Indent' in Tools/Options/Tabs but its options are always grayed. Also always grayed is Edit/Advanced/Format Selection , wich sohuld work with 'smart indent'. So I am still looking for this 'make a nice indenting on my poor looking source' program.

Thanks for answering

Geraldo

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,027 Views
Did you try Michael Metcalf's converter? I didn't try it myself, but it's often recomended on comp.lang.fortran?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,027 Views
...or Alan Miller's to_f90.
0 Kudos
cacciatore
Beginner
1,027 Views

Hi

I have alreadylooked at f2f90 wich is a modified vertion of Michael Metcalf's convert program. f2f90 does not admits tabsand as atthat time I didn't know of the untabfy command I gave up with f2f90, but will try it again as it says it indents DO loops and IF blocks.I just downloaded 'to_f90' and it seems to have many pitfalls like "May do the wrong thing if variable names start with IF or end with DO", and "DO .. END DO (i.e. no label) or in-line comments may cause havoc!", and others.

Thanks again

Geraldo

0 Kudos
Reply