News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Fortran source formatting issues

Started by Tosh, November 27, 2015, 04:29:58 AM

Previous topic - Next topic

Tosh

I just started using the Code::Blocks editor for Fortran. I can't get the source formatter to work properly. For this simple code segment:

    print *,'hello moon'
    !left = (mybankact-tax) * number1
    !iowe = stuff-1;

I get this, when I use "Format using AStyle"

    print *,'hello moon'
    !left = (mybankact-tax) * number1
            !iowe = stuff-1;

I get these strange indents all the way down my code. Anyone know how to get this to work? This is driving me nuts. I have multiple files formatted in really odd ways and I'd like the source formatter to insert blanks/tabs in the appropriate places.

By the way, the file extension is "f.90" and all the syntax highlighting works fine, so code::blocks seems to recognize this is Fortran okay.

oBFusCATed

Have you looked at this page http://astyle.sourceforge.net/ ?
C::B is using AStyle for this formatting and obviously AStyle is made to format only C/C++ like languages and not Fortran.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Tosh

I did not know that. Thanks for the link.