Declared Element Qualities
There are four possible qualities of a declared element that have an effect on how code interacts with it. All declared elements have at least one of these qualities.
- Data type – The values that the element can hold and how it stores those values. See Data Type Summary for more information.
- Lifetime – The period at run-time during which the element is available to use. See Lifetime for more information.
- Scope – The set of all code that can refer to the element without a qualified name. See How to Control the Scope of a Variable for more information.
- Access level – The set of all code that is permitted to use an element.
Qualities by element
The table that follows shows the declared elements and if a quality is applicable.
Element | Data type | Lifetime | Scope | Access level |
---|---|---|---|---|
Variable | Yes | Yes | Yes | Yes |
Constant | Yes | No | Yes | Yes |
Enumeration | Yes | No | Yes | Yes |
Struct | No | No | Yes | Yes |
Property | Yes | Yes | Yes | Yes |
Method | No | Yes | Yes | Yes |
Sub/Function | No | Yes | Yes | Yes |
Procedure parameter | Yes | Yes | Yes | No |
Function/Method return | Yes | Yes | Yes | No |
Trait | No | No | Yes | Yes |
Class | No | No | Yes | Yes |
Event | No | No | Yes | Yes |