Skip to content
Tim edited this page Jan 16, 2016 · 5 revisions

References in Workbench allow developers to reuse code from other scripts. This is useful for developers who create separate programs that will partially share the same code, similar to how class libraries work in C#.

Adding a Reference

  1. To add a reference, right click on References in the project explorer and click Add -> Reference.
  2. When the Add Reference dialog appears, click Browse to open the file you wish to add and click Add.
  3. It will now appear under the References node.

Now that a reference has been added, you will need to import it into your script. This is done using a fake preprocessor directive, "#import"

#import ReferenceName

void Main(string argument)
{
    // do stuff
}

Where ReferenceName equals the name of the Reference you just added to the project. This name must be exact and is case sensitive. Auto-Completion for the imported reference will be updated when the file is saved.