Thursday 25 October 2018

Delphi Classes - fields

Some information I didn’t know about declaring fields in classes.

The var keyword is optional. However, if it is not used, then all field declarations must occur before any property or method declarations. After any property or method declarations, the var may be used to introduce any additional field declarations.
Source: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Fields_(Delphi)


If a member's declaration appears without its own visibility specifier, the member has the same visibility as the one that precedes it. Members at the beginning of a class declaration that do not have a specified visibility are by default published, provided the class is compiled in the {$M+} state or is derived from a class compiled in the {$M+} state; otherwise, such members are public.
Source: http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Classes_and_Objects_(Delphi)

 

No comments:

Post a Comment