Silverfrost Forums

Welcome to our forums

Porting a program fromSalford FTN77

17 Feb 2012 9:17 #9637

I'm quite new to Silverfrost compilers and I've been asked to review and maintain a fairly large codebase written in Salford FTN77/ClearView+. Two questions:

  1. Is FTN77/ClearView+ still available somewhere, so I can try the program as it is?
  2. Is there a porting guide for FTN77 to FTN95? I guess most of the differences will be in ClearView+

Thanks is advance for any help!

17 Feb 2012 11:11 #9638

I don't know if Fortran 77 is still available.

However, you can use the Fortran 95 compiler to compile Fortran 77 programs though. There is also ClearWin+ support.

You probably don't need to convert to Fortran 95 at all unless you are planning on a major re-write of the code. You should not need to make any changes at all if the code worked previously with Salford F77.

17 Feb 2012 11:35 #9639

Quoted from davidb You probably don't need to convert to Fortran 95 at all unless you are planning on a major re-write of the code. You should not need to make any changes at all if the code worked previously with Salford F77.

Thanks, David! I already tried that and I've discovered some differences (minor so far). For instance, in the existing code I see many INCLUDE <windows.ins> and INCLUDE <colours.ins> directives, but I don't see those 2 files in FTN95. Am I missing something?

18 Feb 2012 12:36 #9641

AndreaC,

I don't know a lot about ClearWin+ so you might need to wait for someone else with that specific knowledge to help.

However, on my installation I have windows.ins and colours.ins (and lots of others) in C:\Program Files\Silverfrost\FTN95\include. You should have these files if you did a default install.

Once you get the files, you may need to tell the compiler where these are. In Plato there's an option in project properties for setting the include path, or if you are using the command line there is an option /INCLUDE. Alternatively the < > syntax might mean the include files in the above directory are found automatically.

One more thing, under Tools>Options in Plato there is an option 'Use F77 instead of FTN95' which might be helpful.

David.

18 Feb 2012 3:27 #9642

Quoted from davidb However, on my installation I have windows.ins and colours.ins (and lots of others) in C:\Program Files\Silverfrost\FTN95\include. You should have these files if you did a default install.

Hey David, that's an excellent idea, I did a default installation, but I haven't actually checked whether I installed everything or not. ClearWin+ samples compile, though. But I definitely don't have those 2 files. I'm puzzled... I have to try reinstalling FTN95

18 Feb 2012 5:00 #9646

First of all, FTN95 is completely backwards compatible with FTN77. Yes, the <> syntax tells the compiler to look in the default location for the INS files - i.e. where they were installed.

You should look at the date of the code you are dealing with. There was a very early version of Clearwin for a version of FTN77 transitional between FTN77 with its own DOS-extender (DBOS) and FTN77 for Win32. Information on the development of FTN77 ... FTN95 is given somewhere in the main Silverfrost website. However, the syntax of Clearwin+ has remained unchanged.

You can't port the Clearwin code to anything else (i.e. not Silverfrost)without a huge amount of re-writing, but you don't have to. If anything, the program will run better if recompiled with FTN95 than it did originally.

One change that you might find helps the look and feel of the program is to add the line

1 24 default.manifest

to the resources section (or the RC file) as which gives buttons and windows controls a more modern look and feel.

An old program may (or it may not!) make use of specific fonts. Some of these will have changed or been removed in current versions of Windows, so you may find yourself doing some fine tuning on this. Old windows programs tend to use colours for window backgrounds that look discordant when run in modern versions of Windows. Another thing to look out for.

Eddie

19 Feb 2012 12:40 #9651

Try replacing

INCLUDE <windows.ins>

with

USE clrwin
21 Feb 2012 1:39 #9656

Simon,

I think it highly unlikely that changing an INCLUDE to a USE (regardless of the merits of the Fortran-90/95 syntax) will solve the particular problem, as the INS file is installed into the same folder as the MOD file, and I don't think that it is possible to just install MOD files when you install FTN95. WINDOWS.INS actually contains 3 further nested INCLUDEs, and whether or not CLRWIN.MOD has the same functionality as CLEARWIN.INS (or the three parts of WINDOWS.INS) is something I am not knowledgeable enough to comment on - you can read the INS file, but the contents of the MOD file are not readable.

I recommend changing the absolute minimum of source code when trying to get an old program working. Code that compiled with FTN77 (and Clearwin) should compile and run straightaway with no errors with FTN95 (as noted by davidb). Once it is working then by all means change to a modern syntax. Otherwise, what happens is that you never know where the problem lies: with the original, or with your modifications.

COLOURS.INS sets up the 16 colour names for VGA, which rather suggests that the original application doesn't use RGB_colours, and may look a bit old-fashioned when it runs.

Eddie

21 Feb 2012 3:45 #9657

Thanks everybody for the help! I've reinstalled FTN95 and I got all the include files, indeed. I was able to compile most of the code (even though Plato was not really happy with 800+ source files...) but I have a few syntax errors to fix.

Thanks again, I'm really impressed by the responsiveness of this community!

21 Feb 2012 3:51 #9658

If you have 800+ source files in a Plato project then you may need to disable the dependency checking (found on the main Project menu).

21 Feb 2012 5:20 #9659

Quoted from PaulLaidler If you have 800+ source files in a Plato project then you may need to disable the dependency checking (found on the main Project menu).

Oh, thanks! That's why Plato was choking!

Please login to reply.