A property procedure is a sequence of statements that control a specially-made property on a module, class, or structure. Property procedures are also known as property accessors.
There are two types of property procedures.
Getreturns the value of a property. It is called when you use the property in an expression.
Setsets the value of a property. It is called when you use the property on the left side of an assignment.
You usually define property procedures as a pair with the statements
But, you can define a property with only one procedure.
If it is read-only, then you must supply only
But, if it is write-only, then you must supply only
You do not have to use the procedures
Set if the property is automatically backed.
A property is automatically backed if you do not define property procedures.
But, if you supply the modifier
@Backed, then the property must have the procedure
You can define properties in classes, structures, and modules. Properties have public access. Thus, you can call them from all parts of your program that have access to the container of the property.
See also Differences Between Properties and Variables.
[ modifiers ] Property property_name [ parameter_list ] [ return_type ] Get ' ... Set parameter ' ... End Property