[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|              ACOPY              |
+---------------------------------+
ACOPY(<array1>, <array2>
        [, <expN1> [, <expN2>
        [, <expN3>]]])

-----------------------------------
Copies elements from one array to another.  Returns number of elements
copied to the destination array.
Return value - Numeric
-----------------------------------

<array1>
        The source array.

<array2>
        The target array.

<expN1>
        The element in the source array where copying begins.

<expN2>
        The number of elements to copy.

<expN3>
        The element in the target array where copying begins.

If destination array doesn't exist it is created.  Size of destination
array is same as source array.

Note that you may refer to an element in a two-dimensional memory
variable array in 2 ways.  The first uses 2 subscripts to specify the
row and column position of the element in the array; the other uses a
single element number.  This function and others that manipulate
two-dimensional arrays require an element number (here <expN1> and
<expN3>).  You may use the AELEMENT() function to return the proper
element number for a two-dimensional array from its row and column
subscripts.

+---------------------------------+
|             Example             |
+---------------------------------+

*** SELECT or USE customer database ***
IF USED('customer')
        SELECT customer
ELSE
        USE LOCFILE('customer.dbf','DBF','Where is CUSTOMER.DBF?')
ENDIF

COUNT TO m.count
*** DIMENSION array large enough to hold all of the data *** DIMENSION
companies[m.count,1]

COPY TO ARRAY companies FIELD Company  && Fill the array

DIMENSION temp_comp[m.count,1]

= ACOPY(companies, temp_comp)  && Make a copy of the companies array
DISPLAY MEMORY LIKE *

-----------------------------------

See Also:  ADEL(), AELEMENT(), AINS(), ASCAN(), ASORT()

-----------------------------------

See Also: ADEL() AELEMENT() AINS() ASCAN() ASORT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson