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
  • Syntax
  • Declaring a dynamic object
  • Instantiating a dynamic object
  • Freeing a dynamic object
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
Dynamic instantiation of a .NET object
Overview
A .NET object can be dynamically associated with a .NET class, in which case the object is dynamically instantiated.
Instantiating a dynamic .NET object allows you to create an object at a given time and to free this object when it is no longer used.
To instantiate a .NET object, you must:
  1. declare a dynamic .NET object
  2. instantiate the .NET object
Remark: The object is automatically released when it is no longer used at the end of the application.. However, you can force the object destruction (to trigger the destructor execution for example).
Syntax

Declaring a dynamic object

<Nom Objet> est [un] [objet] <Nom Classe> dynamique
Details of syntax
<Object Name>
Name used to identify the instance of the .NET class.
<Class Name>
Name identifying the class. If the .NET class is named like a WLanguage keyword, the name of the class must be enclosed in quotes (for example, o is "<Class>"(<Parameters>).

Instantiating a dynamic object

<Nom Objet> = allouer un <Nom Classe>([<Paramètres>])
Details of syntax
<Object Name>
Name used to identify the instance of the .NET class.
<Class Name>
Name identifying the class. If the .NET class is named like a WLanguage keyword, the name of the class must be enclosed in quotes (for example, o is "<Class>"(<Parameters>).
<Parameters>
Optional parameters of constructor.

Freeing a dynamic object

libérer <Nom Objet>
Details of syntax
<Object Name>
Name that identifies the instance of the class.
Remarks:
  • The object is automatically freed at the end of the application when it is no longer used. However, you can force the object destruction (to trigger the destructor execution for example).
  • To check whether a dynamic object is allocated and whether it was not freed yet, this object must be compared to NULL. Example:
    SI <Nom Objet> = NULL ALORS ...

    SI <Nom Objet> <> NULL ALORS ...
Versión mínima requerida
  • Versión 9
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