KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Appending an element to an array
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: February 28, 2003

Compatibility: Versions 6.7.x and 6.8.x

Here is a simple project method that will append an element to an array:

` Project Method: Append_Element
` $1 - pointer to an array
` $2 - pointer to a variable of the same type

C_POINTER($1;$2)
C_LONGINT($vlElem)
$vlElem:=Size of array($1->)+1
INSERT ELEMENT($1->;$vlElem)
$1->{$vlElem}:=$2->

Note: This method can be used with any type of array.