02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

INCLUDE<br />

Imports text from a specified file.<br />

Syntax<br />

INCLUDE character-literal-constant<br />

character-literal-constant<br />

Description<br />

is the name of the file to include.<br />

<strong>HP</strong> <strong>Fortran</strong> statements<br />

INCLUDE<br />

The keyword INCLUDE and character-literal-constant form an INCLUDE line, which is<br />

used to insert text into a program prior to compilation. The inserted text replaces the INCLUDE<br />

line; the INCLUDE line should therefore appear in your program where you want the inserted<br />

text. When the end of an included file is reached, the compiler continues processing with the<br />

line following the INCLUDE line.<br />

character-literal-constant can be either a file name or a device name. It must not have a<br />

kind parameter that is a named constant.<br />

The INCLUDE line must appear on one line with no other text except possibly a trailing<br />

comment. It should not have a statement label. Thus, you cannot branch to it, and it cannot be<br />

an action statement that is part of a <strong>Fortran</strong> 90 IF statement. You cannot use the “;” operator<br />

to add a second INCLUDE line, nor can you use the “&” operator to continue it over another line.<br />

The compiler searches directories for the named include files in the following order:<br />

1. The current source directory<br />

2. Directories specified by the -I compile-line option, in the order specified<br />

3. The current working directory<br />

4. The directory /usr/include<br />

INCLUDE lines can be nested to a maximum of ten levels. However, they must be nested<br />

nonrecursively. That is, inserted text must not specify an INCLUDE line that was encountered<br />

at an earlier level of nesting.<br />

Line numbering within the listing of an included file begins at 1. When the included file<br />

listing ends, the include level decreases appropriately, and the previous line numbering<br />

resumes.<br />

Chapter 10 339

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!