Xill enables (and encourages) developers to develop their project across multiple files. This way you can keep your project maintainable and the code re-usable.
Include a bot to make all functions in it available to use in the parent robot. The included functions keep their own scope though.
See also: callbot
Xill scripts can be divided across packages. A project package is a folder that:
- exists in the root of a project or another package
- has a name that starts with an alphabetic character or an onderscore
has a name that consists of only alphanumeric or underscore characters
Note the difference between a project package and a built-in package.
Fully Qualified Name
To address a robot you need a unique identifier for this robot. This is what we call a fully qualified name. This name is constructed from all the parent packages of a robot and its name, separated by a period.
A robot with path module/importbots/main.xill relative to the root of your project will have the fully qualified name
Referencing a Robot
To reference a robot and use its functionality, you can use the
include keyword followed by the fully qualified name.
Now we can use all the functions from the included robot.
An included function keeps its own scope and will therefore only be aware of variables defined inside the function itself. Also, included functions will not be aware of functions defined outside of the same included robot, except when an include command is also used in that included robot, making the library depend on another library.
For more elaborate practical examples, see the tutorial.