Doc: CopyArray

CopyArray - copy an array to another array

Syntax

CopyArray SourceArray(), DestArray() )

  • SourceArray() - array to be copied
  • DestArray() - array to copy to

Explanation

CopyArray copies the data in the elements of an array to another array.

Examples

Copy an Array

The following code creates two arrays, fills the first, then copies the data in the first to the second.

Dim array1$(5)
Dim array2$(5)

array1$(1) = "one"
array1$(2) = "two"
array1$(3) = "three"
array1$(4) = "four"
array1$(5) = "five"

CopyArray array1$(), array2$()

For i = 1 to GetArrayElements( array2$(), 1 )
    Print Str$( i ) + ": " + array2$( i )
Next

Sync
WaitKey

Related Pages

Reference

Categories: Arrays : Functions
page tags: array copy function