Methods
Methods in Spice basically are functions / procedures, assigned to a struct. Within methods, fields of the parent struct can be accessed like this: this.fieldName
.
Usage¶
A basic setup with one struct field, as well es a getter and a setter could look like this:
Spice | |
---|---|
Output:
Text Only | |
---|---|
Tip
You can initialize or destroy structs by using constructors and destructors. Read more about those in the respective documentation section.