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 to . is the beginning element to be copied from ; the default is 1.
- is the number of elements to be copied from ; the default is the entire array.
- is the subscript number in the target array,, to which array elements are to be copied; the default is 1
- This function will copy all data types in to .
- If an array element in is a pointer reference to another array, that array pointer will be copied to ; not all subdimensions will be copied from one array to the next. This must be accomplished via the ACLONE() function.
- Note If array is larger then , array elements will start copying at and continue copying until the end of array is reached. The ACOPY() function doesn't append subscript positions to the target array, the size of the target array remains constant.
- Examples
- LOCAL nCount := 2, nStart := 1, aOne, aTwo
- aOne := {"HABOUR"," is ","POWER"}
- aTwo := {"CLIPPER"," was ","POWER"}
- ACOPY(aOne, aTwo, nStart, nCount)
- Status
Ready
- Compliance
- This function is CA Clipper compliant
- Files
- Library is vm
- See Also