Viva Clipper !

AADD()

Advertisements

AADD()

Dynamically add an element to an array

Syntax

      AADD(<aArray>[, <xValue>]) --> Value

Arguments

<aArray> The name of an array

<xValue> Element to add to array <aArray>

Returns

<Value> if specified <xValue>, <xValue> will return , otherwise this function returns a NIL value.

Description

This function dynamically increases the length of the array named <aArray> by one element and stores the value of <xValue> to that newly created element.

<xValue> may be an array reference pointer, which in turn may be stored to an array’s subscript position.

Examples

      LOCAL aArray := {}
      LOCAL x
      AAdd( aArray, 10 )
      FOR x := 1 TO 10
         AAdd( aArray, x )
      NEXT
      // Result is: { 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }

Compliance

Clipper

Files

Library is vm

Seealso

AINS(), ASIZE()

Advertisements

Advertisements