[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Grow or shrink an array

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


     <aTarget> is the array to grow or shrink.

     <nLength> is the new size of the array.


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


     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.


     .  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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson