Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva
 

ACopy()

 

Copy elements from one array to another

 

Syntax

 

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

 

Argument(s)

 

<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.

 

Example(s)

 

LOCAL nCount := 2, nStart := 1, aOne, aTwo
aOne := { "Harbour", " is ", "Power" }
aTwo := { "Clipper", " was ", "Power" }
ACopy( aOne, aTwo, nStart, nCount )

 

Status

 

Ready

 

Compliance

 

This is CA-Cl*pper v5.2 compliant

 

File(s)

 

Library is core

 

See also

AClone(), ADel(), AEval(), AFill(), AIns(), ASort()