KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: 3 simple ways to reduce the size of an array to 0
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: January 31, 2003
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

Versions: 6.7 and 6.8
Platforms: Mac and Win

Suppose an array “arrLongInt“ has 3 elements:

arrLongInt{1}:=1
arrLongInt{2}:=2
arrLongInt{3}:=3

You can use one of the following methods to reduce the size of arrLongInt to 0:

  ` Method 1: Redeclare the array to size 0
ARRAY LONGINT(arrLongInt;0)

  ` Method 2: Delete all elements in the array
DELETE ELEMENT(arrLongInt;1;Size of array(arrLongInt))

  ` Method 3: Copying an array with of 0 element to it
COPY ARRAY(<>emptyArrLongInt;arrLongInt)