#INCLUDE

You can use this command to include the function declarations of other Dark Basic Professional programs.

  Syntax
#INCLUDE DBA Filename
  Parameters
DBA Filename
Value
Enter the appropriate value here.

  Returns

This command does not return a value.

  Description

You can use this command to simplify your main program by writing sub-programs that hold re-usable independent functions. The #include will associate all the functions within the sub-program with the main program during compilation. The Filename String must specify a Dark Basic Professional program in the current project directory. You can #include up to 255 sub-programs in total. Sub-programs can also use the #include command to further nest sub-programs, but all sub-programs compile into the main program so duplicated function names are not allowed. Be aware that included source code is appended to the end of the program, which means such declarations as TYPE and FUNCTION names included are only valid for use within the included file. If you want to use your TYPE globally, ensure it is declared in your main program.

  Example Code
#INCLUDE "extras.dba"
GOSUB _subroutine_from_extras
END
  See also

CORE Commands Menu
Index