|
Include Statement |
Top Previous Next |
Function: |
Includes a file (such as a header file) at the point of the statement. |
Syntax: |
include “filename” |
Scope: |
Global and HTML |
See Also: |
--- |
Part |
Description |
"filename" |
Contains the filename to be included. The path can be a relative path to the project path, an absolute path (such as c:\myfolder\myfile.tbs) or even a UNC path (such as \\MY-SERVER\Main\myfile.tbs). |
Details
Makes compiler include the contents of a file at the point of the include statement. Usually used to include header files with declarations, definitions for constants, enum types, etc.
Examples
File: global.tbh (a header file)
Declare Function multiply(x As Byte, y As Byte) As Integer Const k=3 'a crucially vital global constant.
|
File: main.tbs (a source code file)
Include "global.tbh" ' now we have access to multiply and to K.
Sub on_sys_init ' ... Dim result As Integer result = multiply(k, 3) ' ... End Sub
|
File: library.tbs (a source code file)
Include "global.tbh"
Public Function multiply(x As Byte, y As Byte) As Integer
multiply = x * y
End Function
|