Usage
The Include
function includes the specified source file into the current script.
Syntax
Include "<source_filename>"
Parameters
<source_filename>
: The source script to be included into the main script at compilation. If the included script is in the same directory as the main script, the full path is not necessary; if not, you must specify the full path for the included script (e.g.,"C:\program files\my_scripts\my_script.src"
). Relative paths are allowed:Include ".\sub1\sub1script1.src"
.
Remarks
If you use multiple Include
lines, you have to ensure that the full long script with those inclusions maintains the correct program structure: first the Dim
lines, second the Functions and Subs definitions, and last the main program. You also need to ensure that all the Subs/Functions are declared before using them in another Function/Sub. Ensure that there are no duplicate names, and for maintenance ease, it is recommended to use different parameter names within the different Functions/Subs.
See Also
- Program Structure
Example
Include "script1.src"