KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Several ways to clean up arrays
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: December 5, 2005
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

It is good programming practice to clean up arrays after they are no longer needed. In 4D, here are a number of simple ways to clear an array:

- Manually delete each element in the array
DELETE ELEMENT(myArray;1; Size of Array(myArray) )

- Initialize the array to zero elements
ARRAY TEXT(myTextArray;0)

- You can also clear the array by using CLEAR VARIABLE(myArray) if you don't need it defined in interpreted mode any longer.