Silverfrost Forums

Welcome to our forums

Free Source Form Criteria

10 Feb 2014 5:57 #13680

I am compiling a program with Silverfrost FTN95 that compiles using the COMPAQ DVF compiler. I was getting syntax errors and one of the issues seems to be the length of the free source form line of code. (When I reduce the amount of indent white space at the start of the line the error goes away.) So I suspect COMPAQ DVF allows a longer length source code line then Silverfrost FTN95.

I have been looking in the FTN95 documentation, but I don't see where the free source form criteria and limitations/extensions are spelled out. Can someone please direct me to where in the documentation I need to look for documentation on free source form? Also - How does the compiler know if the form syntax has been entered as free or fixed? Is it by the source file extension? Thank you.

10 Feb 2014 7:11 #13681

You can have up to 132 characters by default. The difference may be due to the tab size - FTN95 replaces a tab by 8 spaces.

10 Feb 2014 10:00 #13685

Thank you very much.

The 132 character limit and the conversion of tabs to 8 spaces explains why bringing the DVF source into FTN95 has an issue.

In Visual Studio’s editor it would be nice to have text beyond 132 characters changed to a different color. (Like text beyond 72 characters is given different color for FORTRAN fixed form files.)

10 Feb 2014 10:16 #13687

I am not sure about the FTN95 plug-in for Visual Studio but Plato only does this for fixed format Fortran files.

However, to make this work you have to set the tab size in the editor (Plato or VS) to 8 in order to match the FTN95 compiler.

p.s. On second thoughts, in the editors, tabs form columns whilst FTN95 will simply replace every tab with 8 spaces. So it just won't work.

11 Feb 2014 2:15 #13691

As far as I know, tabs are not included in the Fortran standard character set, both for code and also in formatted text files for I/O. Given how their interpretation is different for most IDE's or compilers, I would recommend against ever using them.

John

11 Feb 2014 8:54 #13695

Plato has a command for replacing all tabs (within the current file) with spaces. You will find it under then menu Tools, then Options, then Environment->Keyboard. You will find it named as Edit.ReplaceTabs and from there you will be able to assign an accelerator key of your choice.

Please login to reply.