forked from processing-js/processing-js.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
78 lines (68 loc) · 2.37 KB
/
Copy pathindex.html
File metadata and controls
78 lines (68 loc) · 2.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
layout: withcc
title: arrayCopy() | reference
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>arrayCopy()</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><pre>String[] north = { "OH", "IN", "MI"};
String[] south = { "GA", "FL", "NC"};
arrayCopy(north, south);
print(south); // Prints OH, IN, MI</pre><hr />
<pre>String[] north = { "OH", "IN", "MI"};
String[] south = { "GA", "FL", "NC"};
arrayCopy(north, 1, south, 0, 2);
println(south); // Prints IN, MI, NC</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td>
<p>Copies an array (or part of an array) to another array. The <b>src</b> array is copied to the <b>dst</b> array, beginning at the position specified by <b>srcPos</b> and into
the position specified by <b>dstPos</b>. The number of elements to copy is determined by <b>length</b>. 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 <b>for</b> and copying each element.</p></td>
</tr>
<tr class="">
<th scope="row">Syntax</th>
<td><pre>arrayCopy(<kbd>src</kbd>,<kbd>dest</kbd>)</pre><br />
<pre>arrayCopy(<kbd>src</kbd>,<kbd>dest</kbd>,<kbd>length</kbd>)<br />
arrayCopy(<kbd>src</kbd>,<kbd>srcPos</kbd>,<kbd>dest</kbd>,<kbd>destPos</kbd>,<kbd>length</kbd>)</pre></td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td><table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">src</th>
<td>an array of any data type: the source array</td>
</tr>
<tr class="">
<th scope="row">dest</th>
<td>an array of any data type (as long as it's the same as src): the destination array</td>
</tr>
<tr class="">
<th scope="row">srcPos</th>
<td>int: starting position in the source array</td>
</tr>
<tr class="">
<th scope="row">destPos</th>
<td>int: starting position in the destination array</td>
</tr>
<tr class="">
<th scope="row">length</th>
<td>int: number of array elements to be copied</td>
</tr>
</table></td>
</tr>
<tr class="">
<th scope="row">Returns</th>
<td>None</td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
</table>