ACopy()

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()

3 responses to “ACopy()

  1. Pingback: Harbour All Functions — A | Viva Clipper !

  2. Pingback: Harbour Array Functions | Viva Clipper !

  3. Pingback: Harbour RG Summary | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.