AngelScript
 
Loading...
Searching...
No Matches
Include directive

Path: /sdk/samples/include/

This sample shows how to implement a very simple preprocessor to add support for the #include directive, which allow the script writer to reuse common script code. The preprocessor simply adds the included scripts as multiple script sections, which is ok as AngelScript is able to resolve global declarations independently of their order. The preprocessor also makes sure that a script file is only included once, so the script writer doesn't have to take extra care to avoid multiple includes or even complicated circular includes.

  • Script builder
  • LineCallback() functions which aborts execution when the time is up
  • Processing the #include directive
  • Circular #includes are resolved automatically