4D v14.3CLEAR VARIABLE |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
CLEAR VARIABLE
|
CLEAR VARIABLE ( variable ) | ||||||||
Parameter | Type | Description | ||||||
variable | Variable |
![]() |
Variable to clear | |||||
CLEAR VARIABLE resets variable to its default type value (i.e., empty string for String and Text variables, 0 for numeric variables, no elements for arrays, etc.). The variable still exists in memory.
The variable you pass in variable can be a local, process or interprocess variable.
Note: You do not need to clear process variables when a process ends; 4D clears them automatically. Similarly, each local variable is automatically cleared when the method in which it was created completes execution.
In a form, you are using the drop-down list asMyDropDown whose sole purpose is user interface. In other words, you use that array during data entry, but once you are done with the form, you will no longer use that array. Consequently, during the On Unload event, you just get rid of the array:
` asMyDropDown drop-drop list object method
Case of
:(Form event=On Load)
` Initialize the array one way or another
ARRAY STRING(63;asMyDropDown;...)
` ...
:(Form event=On Unload)
` No longer need the array
CLEAR VARIABLE(asMyDropDown)
` ...
End case
Product: 4D
Theme: Variables
Number:
89
Modified: 4D v11 SQL
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)