C5_ASIZE

 ASIZE()
 Grow or shrink an array
------------------------------------------------------------------------------
 Syntax

     ASIZE(<aTarget>, <nLength>) --> aTarget

 Arguments

     <aTarget> is the array to grow or shrink.

     <nLength> is the new size of the array.

 Returns

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

 Description

     ASIZE() is an array function that changes the actual length of the
     <aTarget> array.  The array is shortened or lengthened to match the
     specified length.  If the array is shortened, elements at the end of the
     array are lost.  If the array is lengthened, new elements are added to
     the end of the array and assigned NIL.

     ASIZE() is similar to AADD() which adds a single new element to the end
     of an array and optionally assigns a new value at the same time.  Note
     that ASIZE() is different from AINS() and ADEL(), which do not actually
     change the array's length.

     Note:  ASIZE() only supports single-dimensional arrays.

 Examples

     .  These examples demonstrate adding new elements and deleting
        existing elements:

        aArray := { 1 }          // Result: aArray is { 1 }
        ASIZE(aArray, 3)         // Result: aArray is { 1, NIL, NIL }
        ASIZE(aArray, 1)         // Result: aArray is { 1 }

 Files   Library is CLIPPER.LIB.

See Also: AADD() ADEL() 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.