PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Special case: the dynamic arrays
  • Special case: the dynamic automation objects
  • Special case: the class objects and the dynamic class objects
  • Freeing the memory space
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Delete (Reserved word)
In french: Libérer
The memory occupied by a dynamic object (array, class object, ...) is automatically freed when the object is no longer used or when closing the element (window, report, ...) in which the dynamic object was declared.
Delete is used to explicitly free the memory occupied by:
The use of Delete is optional. Delete allows the developer to quickly free the available memory space.
Example
CustomerArray is dynamic array
CustomerArray = new dynamic array of 4 by 7 int
...
// Free the dynamic array
delete CustomerArray
Syntax
Delete <Name of Dynamic Object to Free>
<Name of Dynamic Object to Free>: Character string
Name of the dynamic object to free explicitly. This dynamic object can correspond to:
Remarks

Special case: the dynamic arrays

  • A dynamic array is automatically freed at the end of the lifetime of the variable (when the window is closed for example) or when allocating new dimensions.
  • If the declaration and the allocation of the dynamic array are performed in a single code line, Delete must not be used to explicitly free the dynamic array. A runtime error will occur if Delete is used.
    See Dynamic arrays for more details.

Special case: the dynamic automation objects

The dynamic automation object is automatically freed at the end of the process containing its declaration or during a new allocation of the object.
Versions 16 and later

Special case: the class objects and the dynamic class objects

To free an object, you also have the ability to use the following syntax:
<Object Name> = NULL
New in version 16

Special case: the class objects and the dynamic class objects

To free an object, you also have the ability to use the following syntax:
<Object Name> = NULL

Special case: the class objects and the dynamic class objects

To free an object, you also have the ability to use the following syntax:
<Object Name> = NULL

Freeing the memory space

You can also:
  • Free the memory space used by a matrix with MatDelete.
  • Free the memory space occupied by a matrix used by a chart with grDeleteAll.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment