Difference between revisions of "Include"
From Mesham
Jump to navigationJump to search (Created page with '== Syntax == #include [sourcefile] == Semantics == Will read in the Mesham source file specified and will embed the contents of this source file into the code at the current l…') |
m (5 revisions imported) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Syntax == | == Syntax == | ||
− | #include [sourcefile] | + | <nowiki>#</nowiki>include [sourcefile] |
== Semantics == | == Semantics == | ||
Line 15: | Line 15: | ||
The preprocessor will search the include directories when the filename is contained in quotation marks. If contained within ''< >'' then the preprocessor will search the system include locations too which have priority. | The preprocessor will search the include directories when the filename is contained in quotation marks. If contained within ''< >'' then the preprocessor will search the system include locations too which have priority. | ||
+ | |||
+ | ''Since: Version 1.0'' | ||
[[Category:preprocessor]] | [[Category:preprocessor]] |
Latest revision as of 15:44, 15 April 2019
Syntax
#include [sourcefile]
Semantics
Will read in the Mesham source file specified and will embed the contents of this source file into the code at the current location
Example
#include "test.mesh" #include <io>
The preprocessing stage will replace the first include with the contents of test.mesh, followed by the second include replaced by io. In the absence of the .mesh ending, the preprocessor will attempt to match on the absolute filename first and if this can not be found will then look for a file with the corresponding name and .mesh ending.
The preprocessor will search the include directories when the filename is contained in quotation marks. If contained within < > then the preprocessor will search the system include locations too which have priority.
Since: Version 1.0