Silverfrost Forums

Welcome to our forums

INCLUDE meaning

1 Jul 2011 5:38 #8489

I have been going through another person's (who is currently not accesable for me) code of Fortran 77 and am relatively new to Fortran.

He uses a keyword 'INCLUDE' whilst declaring variables, like include something.inc.

What does it indicate?

1 Jul 2011 6:44 #8491

It describes another file that is to be inserted into the code at that point.

1 Jul 2011 3:52 #8497

... and there's another bit of valuable knowledge. In FTN95, enclosing the filename in 'diamond brackets' means 'go and look for it in FTN95's folders', e.g

      INCLUDE <WINDOWS.INS>

(although this is non-standard), whereas if the filename is treated as a literal, e.g.

      INCLUDE 'C:\\PROGRAM\\something.inc'

then that tells the compiler where to look (or if a path isn't given, look in the working folder).

The relevant bit in FTN95's help file describes INCLUDE as a 'compiler directive', and notes that it can occur anywhere in source code, including in an INCLUDE file, nesting up to 10 deep.

Eddie

Please login to reply.