Silverfrost Forums

Welcome to our forums

Beginner: Help urgently wanted!

6 Jun 2008 7:29 #3309

From a [u:a9053fcf29]complete [/u:a9053fcf29]beginner. I have used Fortran on main-frames since 1963, professionally. Now, in retirement, I want to use it on my PC (non-professionally). I have downloaded and installed FTN95, apparently successfully. What do I do next? I downloaded the FTN95 user guide (help file), but it won't open. Do I need Windows Visual Studio 2005 to proceed? I have absolutely no clue what to do next. Any help greatly appreciated

Farfleet

6 Jun 2008 11:53 #3311

Hi,

No you don't need Visual Studio, you can simply open up the FTN95 DOS window which should be one of the Silverfrost commands available. Locate your directory containg your code, in .FOR files for example. For the complete code in one file, type: ftn95 myfile.for/fixed/zeroise/save/list/nowindows/link

and the executable should apper

try

ftn95/?

to give help on the switches.

For the help file, locate ftn95.chm and double click it.

For multi-file linking, compile as above without the /link switch. Create a text file (say linkfile) containing a list of object files to be loaded, e.g.

lo myfile1 lo myfile2 lo myfile3 file myexe

link with:

slink linkfile

For more advanced usage, investigate Plato the integrated development environment.

Regards

Ian

6 Jun 2008 1:21 #3313

Most people find it simpler and quicker to start with Plato. This is an editor that allows you to open and compile programs. The alternative is to use Visual Studio with the FTN95 plug-in.

6 Jun 2008 9:10 #3319

Paul is probably right. However, I don't get on with Plato (not a Republican!). I use a file editor for windows that has a dos box (http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/default.htm) which I like a whole lot better - I'm an old dog, and Plato is a 'new trick'

Eddie

8 Jun 2008 8:30 #3322

I'm baffled that you call yourself a complete beginner with 45 years of experience !

Like Eddie, I also work from a DOS command window and use the same file editor (pfe32.exe). I compile with a command line and also sometimes with a batch file. So long as your PATH definition includes 'C:\Program Files\Silverfrost\FTN95' and you have an environmental variable called f95include and is defined as 'C:\Program Files\Silverfrost\FTN95\include' then compiling and linking your source code should be more or less the same as you would have done on a mainframe. Both the path and evironment variables can be seen and modified in Control Panel → System → Advanced

Fortran 95 is fully backwards compatible to Fortran 77, thus you shouldn't hit any problems, so long as you don't revert to Fortran IV or any earlier version !

8 Jun 2008 8:48 #3323

Hi Farfleet,

I read your original post again. If you have PFE, then run it. Make a file with the following contents, and save it as (say) test.for (use the trad fixed format for now, so statements start in column 7):

      WINAPP
      OPTIONS(INTL)
      PROGRAM TEST
 10  CONTINUE
      WRITE(*,*) ' Hello World'
      GO TO 10
      END

Click on the icon to launch a DOS window. This opens with white text on a black background. Type:

FTN95 -LGO TEST.FOR

The program compiles, links and runs. Any compilation messages go into the DOS box. It will write ' Hello World' into yet another window. This will be black text on a white background.

Now edit TEST.FOR, taking out the WINAPP line. Compile and run (LGO means 'load and go'). Now, you have a pure console application. The 'Hello World' message will go into the DOS window, not into a separate console window!

Now put WINAPP back, and modify the file to read:

      WINAPP
      OPTIONS(INTL)
      PROGRAM TEST
      IA=WINIO@('%ca[Hello World]%bt[Exit]')
      END

Compile and run that. It is a CLEARWIN+ application.

Now you are on your own with the on-line help file!

If you can get to Kingston upon Thames I'm at the Uni there, and would give you a further tutorial if you turned up when I'm free over the summer ...

Regards

Eddie

Please login to reply.