Property Statement

Declares the names of properties and the procedures called when storing and retrieving values.

Syntax

[ modifier ] [ Var ] Property declarator
[ Begin [ parameterList ]
  [ Get
    [ statements] ]
  [ Set parameter
    [ statements] ]
End Property ]
or
[ modifier ] Property declarator [ , declarator ]... [ Does traitName . oldName ]

Parts

modifier
Optional. One of the following:
  • Abstract — Specifies that the property contains no implementation and must be overridden in a concrete class.
  • Abstract Get — Specifies that the property is read-only and its Get handler must be implemented in a concrete class.
  • Abstract Set — Specifies that the property is write-only and its Set handler must be implemented in a concrete class.
  • Override — Specifies that the property is a re-implementation of a property inherited from a base class.
  • Shared — Specifies that the property is owned by the enclosing class and not an instance of that class.
Var
Optional. Explicitly specifies that the property is backed.
declarator
Required. One or more declarative clauses that have a similar syntax to the Dim statement. The simple property permits multiple declarators separated by commas.

Syntax

name [ ( [ dimensions ] ) ] [ As type | In unit ] [ = initializer ]
name
Required identifier or object handle
dimensions
Optional. One or more integer expressions separated by commas. Not permitted on unbacked properties.
type
Optional data type
unit
Optional unit of measure
initializer
Optional expression having a data type compatible with type or unit.
Begin
Optional. Marks the start of the multi-line form of the Property statement.
parameterList
Optional. Allowed only if the property is an array. A list of integer parameters, separated by commas, which hold the array indices supplied by the caller.
Get
Marks the start of a procedure that is called when retrieving the current value of the property.
Set
Marks the start of a procedure that is called when storing a new value in the property.
parameter
Required after Set. It must be the same data type as the property. If you do not specify a data type, the type of the property is assumed.
statements
Optional
End Property
Terminates the multi-line form.

Remarks

A property, like a method, has public visibility. You may declare a property anywhere a method is permitted, namely, within modules, classes, and traits.

By default, ViviFire's properties are implicitly backed. This means that a property declared in the same way as a variable has all of the features of a variable in addition to being publicly accessible.

Examples

See also