Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>acopy()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ACOPY()
 Copy elements from one array to another
------------------------------------------------------------------------------
 Syntax

     ACOPY(<aSource>, <aTarget>,
        [<nStart>], [<nCount>], [<nTargetPos>]) --> aTarget

 Arguments

     <aSource> is the array to copy elements from.

     <aTarget> is the array to copy elements to.

     <nStart> is the starting element position in the <aSource> array.
     If not specified, the default value is one.

     <nCount> is the number of elements to copy from the <aSource> array
     beginning at the <nStart> position.  If <nCount> is not specified, all
     elements in <aSource> beginning with the starting element are copied.

     <nTargetPos> is the starting element position in the <aTarget> array
     to receive elements from <aSource>.  If not specified, the default value
     is one.

 Returns

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

 Description

     ACOPY() is an array function that copies elements from the <aSource>
     array to the <aTarget> array.  The <aTarget> array must already exist
     and be large enough to hold the copied elements.  If the <aSource> array
     has more elements, some elements will not be copied.

     ACOPY() copies values of all data types including NIL and code blocks.
     If an element of the <aSource> array is a subarray, the corresponding
     element in the <aTarget> array will contain a reference to the subarray.
     Thus, ACOPY() will not create a complete duplicate of a multidimensional
     array.  To do this, use the ACLONE() function.

 Examples

     .  This example creates two arrays, each filled with a value.
        The first two elements from the source array are then copied into the
        target array:

        LOCAL nCount := 2, nStart := 1, aOne, aTwo
        aOne := { 1, 1, 1 }
        aTwo := { 2, 2, 2 }
        ACOPY(aOne, aTwo, nStart, nCount)
        // Result: aTwo is now { 1, 1, 2 }

 Files:  Library is CLIPPER.LIB.

See Also: ACLONE() ADEL() AEVAL() AFILL() AINS() ASORT()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson