FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

arraycopy()

   
Examples  
String north[] = { "OH", "IN", "MI"}; 
String south[] = { "GA", "FL", "NC"}; 
arraycopy(north, south); 
print(south);  // Prints "OH IN MI" 
 


String north[] = { "OH", "IN", "MI"}; 
String south[] = { "GA", "FL", "NC"}; 
arraycopy(north, 1, south, 0, 2); 
print(south);  // Prints "IN MI NC" 
 

Description   Copies an array (or part of an array) to another array. The src array is copied to the dst array, beginning at the position specified by srcPos and into the position specified by dstPos. The number of elements to copy is determined by length. The simplified version with two arguments copies an entire array to another of the same size. It is equivalent to "arraycopy(src, 0, dst, 0, src.length)". This function is far more efficient for copying array data than iterating through a for() and copying each element.
   
Syntax  
arraycopy(src, dest)
arraycopy(src, srcPos, dest, destPos, length)
   
Parameters  
src   booleans[], bytes[], chars[], ints[], floats[], or Strings[]: the source array

dest   booleans[], bytes[], chars[], ints[], floats[], or Strings[]: the destination array

srcPos   int: starting position in the source array

destPos   int: starting position in the destination array

length   int: number of array elements to be copied

   
Returns   None
   
Usage   Web & Application
   
 
 






   
 
Updated: Fri Jul 15 16:35:29 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info