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 beginning subscript position to copy from <aSource>
<nCount> the number of subscript elements to copy from <aSource>.
<nTargetPos> the starting subscript position in <aTarget> to copy elements to.
Returns
<aTarget> an array pointer reference
Description
This function copies array elements from <aSource> to <aTarget>.
<nStart> is the beginning element to be copied from <aSource>; the default is 1.
<nCount> is the number of elements to be copied from <aSource>; the default is the entire array.
<nTargetPos> is the subscript number in the target array, <aTarget>, to which array elements are to be copied; the default is 1
This function will copy all data types in <aSource> to <aTarget>.
If an array element in <aSource> is a pointer reference to another array, that array pointer will be copied to <aTarget>; not all subdimensions will be copied from one array to the next. This must be accomplished via the ACLONE() function.
Note: If array <aSource> is larger then <aTarget>, array elements will start copying at <nTargetPos> and continue copying until the end of array <aTarget> is reached. The ACOPY() function doesn’t append subscript positions to the target array, the size of the target array <aTarget> remains constant.
Examples
LOCAL nCount := 2, nStart := 1, aOne, aTwo aOne := { "HARBOUR", " is ", "POWER"} aTwo := { "CLIPPER", " was ", "POWER"} ACopy( aOne, aTwo, nStart, nCount )
Compliance
Clipper
Files
Library is vm
Seealso
ACLONE(), ADEL(), AEVAL(), AFILL(), AINS(), ASORT()
Pingback: Harbour All Functions — A | Viva Clipper !
Pingback: Harbour Array Functions | Viva Clipper !
Pingback: Harbour RG Summary | Viva Clipper !