C5_ADEL

 ADEL()
 Delete an array element
------------------------------------------------------------------------------
 Syntax

     ADEL(<aTarget>, <nPosition>) --> aTarget

 Arguments

     <aTarget> is the array to delete an element from.

     <nPosition> is the position of the target array element to be
     deleted.

 Returns

     ADEL() returns a reference to the target array, <aTarget>.

 Description

     ADEL() is an array function that deletes an element from an array.  The
     contents of the specified array element is lost, and all elements from
     that position to the end of the array are shifted up one element.  The
     last element in the array becomes NIL.

     Warning!  Clipper implements multidimensional arrays by nesting
     arrays within other arrays.  If the <aTarget> array is a
     multidimensional array, ADEL() can delete an entire subarray specified
     by <nPosition>, causing <aTarget> to describe an array with a different
     structure than the original.

 Examples

     .  This example creates a constant array of three elements, and
        then deletes the second element.  The third element is moved up one
        position, and the new third element is assigned a NIL:

        LOCAL aArray
        aArray := { 1, 2, 3 }      // Result: aArray is
                                   // now { 1, 2, 3 }
        ADEL(aArray, 2)            // Result: aArray is
                                   // now { 1, 3, NIL }

 Files   Library is CLIPPER.LIB.


See Also: ACOPY() AFILL() AINS()

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.