Author Topic: Fortran source formatting issues  (Read 1329 times)

Offline Tosh

  • Single posting newcomer
  • *
  • Posts: 2
Fortran source formatting issues
« on: November 27, 2015, 04:29:58 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12911
    • Travis build status
Re: Fortran source formatting issues
« Reply #1 on: November 27, 2015, 06:29:18 am »
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!]

Offline Tosh

  • Single posting newcomer
  • *
  • Posts: 2
Re: Fortran source formatting issues
« Reply #2 on: November 27, 2015, 08:08:51 am »
I did not know that. Thanks for the link.