View previous topic :: View next topic |
Author |
Message |
christyleomin
Joined: 08 Apr 2011 Posts: 155
|
Posted: Fri Jul 01, 2011 6:38 am Post subject: INCLUDE meaning |
|
|
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? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Fri Jul 01, 2011 7:44 am Post subject: |
|
|
It describes another file that is to be inserted into the code at that point. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2388 Location: Yateley, Hants, UK
|
Posted: Fri Jul 01, 2011 4:52 pm Post subject: |
|
|
... 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
Code: | INCLUDE <WINDOWS.INS> |
(although this is non-standard), whereas if the filename is treated as a literal, e.g.
Code: | 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 |
|
Back to top |
|
|
|