-
Notifications
You must be signed in to change notification settings - Fork 0
Modules
Modules in Aussom are simply other .ca files that you want to include. To include other modules, use the 'include' key word. When including modules, use the module name without the file extension. Also, Aussom module files must not contain periods or spaces. It's best to stick with letters, numbers and underscores for module names.
When Aussom looks for modules, it looks in a few locations within the Aussom install path. One of these folders is 'modsys', which is the directory where the standard library modules are located.
Aussom will also search the current path where the executing script is located. Modules can be located in sub folders as well. If in sub folders, use the period to specify the path. Here are a few examples.
include sys; // The sys.ca file is located in the modsys directory.
include myModule; // Aussom will search for myModule.ca file within the current path.
include folder.myMod; // Aussom will search for myMod.ca file within the folder directory
// within the current path.
Modules are normally included in the begining of the file. They can also be included within a function as well if delayed loading is desired. Here are a couple examples.
include sys; // Module is included at initial parse time.
class myClass {
public main(args) {
c.log("I will now load another module ...");
this.myFunct();
}
public myFunct() {
include myModule; // Module is included after execution has started.
}
}