AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / POO (Programación Orientada a Objetos)
  • Overview
  • Access rights
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Overview
A property is a code element that includes two processes:
  • a process for retrieving the value,
  • a process for assigning the value.
A property can be used like a variable or like a member (direct retrieval of the value, assignment via the '=' symbol, ...). At runtime:
  • Any operation that requires reading the property runs the process for retrieving the value. This process must return a value.
  • Any operation that requires writing the property executes the process to assign a value that must process a parameter.
Read-only property
In order for a property to be read-only, the assignment code of the property must be entirely cleared.
In this case:
  • If the property is modified in the code, a compilation error occurs.
  • An error will occur at runtime when trying to assign the property.
Write-only property
In order for a property to be write-only, the retrieval code of the property must be entirely cleared.
In this case:
  • If the property is read in the code, a compilation error occurs.
  • An error will occur at runtime when trying to read the property.
Access rights
The retrieval and assignment processes can be public, private or protected. The access rights of the property correspond to the less restrictive rights of the two processes.
Property access rights based on treatment access rights:
Assignment process
/
Retrieval process
Public
Protected
Private
PublicPublicPublicPublic
ProtectedPublicProtectedProtected
PrivatePublicProtectedPrivate
The properties are accessible on the instances and by inheritance by respecting the standard restrictions of the public, protected and private inheritances.
If the access rights allow reading and not writing, the property is considered read-only.
If the access rights allow writing and not reading, the property is considered write-only.
These cases trigger an error during the compilation but no error is triggered at runtime. For more details, see Access rights to a class property: special cases.
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 21/09/2024

Señalar un error o enviar una sugerencia | Ayuda local