Declares method as property.
Method Identifier: ReturnType ( Parameters ) [
Property ] [ Abstract ] [ Final ]
End [ Method ]
The Property keyword declares that a method is acting as a class property. Properties are generally used to access a single (usually private) field in a controlled fashion.
Unlike a standard method, a property acts as a proxy for a field, and so can be written to (and read from) using the same syntax as for a field or variable. For example, reading a property:
Note that because it's acting like a field, no method-call brackets are required.
Writing to a property:
Properties are usually declared in pairs with the same name:
- a 'read' version with no parameters which reads a specific field, and;
- a 'write' version with a single parameter which writes to the same field.
Properties with multiple parameters cannot use this shortened syntax and must be called in the same way as a standard method.
' Runnable example...
"Sent for security check!"
' 00000 ' Join to trigger security check!