Repository navigation
Tutorials: Classes & Fields
nova ✩ edited this page Oct 5, 2026
·
22 revisions
It's a kind of structure that holds it's own values and functions. You can make multiple instances of a class, each with its own data.
class ExampleClass:
# still explainingCreating an instance of a class
set {_myInstance} to new instance of ExampleClass
set {_myInstance} to new ExampleClassImportant
Class names must be written in TitleCase when referenced in any syntax. This is a pattern level requirement so you may not get a descriptive error.
Fields are part of the class and can hold data, they accept a specified type and can optionally hold default values. Here is an example of a field
class Example:
public counter: integerThe public modifier means we can access this field from anywhere (more on this later).
Now we can access the field like this:
set {_instance} to new instance of Example
increase {_instance}::counter by 1We can also assign a default value to the field like this:
class Example:
public counter: integer = 1