Versions Compared
Version | Old Version 8 | New Version 9 |
---|---|---|
Changes made by | Former user |
Former user |
Saved on |
Key
- This line was added.
- This line was removed.
- Formatting was changed.
High Level Constructs
unit
Units are groupings of functions and also variables.
They can be thought of as modules or namespaces. A Mezzanine script must have at least one unit.Unit must be followed with a unique unit name. Units are defined as follows.
Info |
---|
|
Objects, enums and validators are global, so they can optionally be in a separate source code file without a unit. Status colour Blue title Heads Up
Mez File Comments
Two types of comments are supported
Single line comments
Info |
---|
|
And multi-line comments:
Info |
---|
|
This unit has one unit variable named myVar. This variable has unit scope and can be accessed by any function in the unit. The unit also has a function named factorial. A unit must have at least one function. To refer to a unit’s member functions or variables from another unit, you have to use the scope operator
Info |
---|
|
Note: Unit variables cannot be in line initialized when they are declared. The following code will not compile
Info |
---|
|