|
|
|
|
|
- Overview
- Syntax
- Declaring a dynamic object
- Instantiating a dynamic object
- Freeing a dynamic object
Dynamic instantiation of a .NET object
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: - declare a dynamic .NET object
- 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). 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 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 ...
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|