Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> include include source file pp 147</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 INCLUDE                     Include Source File                      pp 147


 Define:  The {$I filename} compiler directive to include a separate
          source file in the main program file.

 Purpose: Provides for use of library type source files and keeping of main
          source file at a smaller size.

 Notes:   Include files can not be nested, where one Include file calls
          for another Include file.

          If no file extension is given, .PAS is assumed.  A space must
          be left between the filename and the closing brace if no extension
          is given, or else the closing brace is considered part of the file
          name.

          Include files are useful for any routines that can be ported from
          one program to another.  This allows changes to be made only to the
          library file instead of each and every occurrence of that file in
          all programs it is used in.

          Turbo supports free ordering and multiple occurrences of the
          declarative sections.  Include files may also contain declarations
          as well as code.

          All compiler directives except {$B} and {$C} are local to
          the file they are declared in.  If a compiler directive is set to
          a different value in an Included file, that directive will be reset
          to its original value upon return to the Including file.


 ----------------------------------------------------------------------------


 Usage:
       {$I FileName.Ext}     { Include a source file at any location }
       {$I FileName }        { Space before closing brace            }

       BEGIN
       {$I CodeFile.Ext}     { Include another file at this location }
       END.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson