include and @use: Load Another Source File

breve includes a rich hierarchy of classes that are used to construct simulations. To use a class that comes with breve (or another file which you have created yourself), you must tell breve to load in its associated class file. You need to load a class before you instantiate it or subclass it.

Classes are loaded using the @include directive. It is used simply by specifying the name of the file to include:

@include "Control.tz".

@use works the same way, but with a slightly different syntax, leaving out the quotes and the ".tz" from the file name:

@use Control.

There is no difference between @include and @use in terms of how files are actually loaded.

@include directives are not only used to include classes that come with the breve distribution, but also potentially classes that you construct yourself. They are often used in conjunction with the @path directive ([link]) to specify the location of classes before loading them.