<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.herc.ws/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Copyarray</id>
		<title>Copyarray - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.herc.ws/w/index.php?action=history&amp;feed=atom&amp;title=Copyarray"/>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Copyarray&amp;action=history"/>
		<updated>2026-05-01T05:33:32Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.11</generator>

	<entry>
		<id>https://wiki.herc.ws/w/index.php?title=Copyarray&amp;diff=182&amp;oldid=prev</id>
		<title>Nameless2you: Created page with &quot;==Syntax== *'''copyarray''' &lt;destination array&gt;, &lt;source array&gt;, &lt;amount of elements to copy&gt;;  ==Description== This command copies a range of values from given source array t...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.herc.ws/w/index.php?title=Copyarray&amp;diff=182&amp;oldid=prev"/>
				<updated>2013-01-13T19:42:45Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Syntax== *&amp;#039;&amp;#039;&amp;#039;copyarray&amp;#039;&amp;#039;&amp;#039; &amp;lt;destination array&amp;gt;, &amp;lt;source array&amp;gt;, &amp;lt;amount of elements to copy&amp;gt;;  ==Description== This command copies a range of values from given source array t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Syntax==&lt;br /&gt;
*'''copyarray''' &amp;lt;destination array&amp;gt;, &amp;lt;source array&amp;gt;, &amp;lt;amount of elements to copy&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
This command copies a range of values from given source array to given destination array. If you specify an index for either or both, the data will be copied string from or to the given index.&lt;br /&gt;
&lt;br /&gt;
If copying would add more than 128 elements to the destination array, the remaining elements are cut off. If a combination of index and amount of elements to copy go beyond the 127th element, empty values, 0 or &amp;quot;&amp;quot; depending on array type, are assumed.&lt;br /&gt;
&lt;br /&gt;
Note, that destination array and source array can point to the same variable, where the indexes differ.&lt;br /&gt;
&lt;br /&gt;
Avoid use of script command [[getarraysize]] for the third parameter, if the array in question contains empty values, otherwise copyarray might not copy as many elements, as intended.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
 [[cleararray]] @arrayl[0], 100, 6;  // { 100, 100, 100, 100, 100, 100 }&lt;br /&gt;
 [[setarray]] @arrays[0], 200, 300, 400, 500;&lt;br /&gt;
 copyarray @arrayl[2], @arrays, 4;&lt;br /&gt;
Copies the first 3 elements of ''@arrays'' to ''@arrayl'' starting at index 2, resulting in ''@arrayl'' being { 100, 100, 200, 300, 400, 100 }.&lt;br /&gt;
&lt;br /&gt;
 copyarray @array[0], @array[1], 99;  // assuming @array has 100 elements&lt;br /&gt;
 [[set]] @array[99], 0;  // wipe last element&lt;br /&gt;
This shifts all elements inside ''@array'' by one towards index 0, effectively removing the first element.&lt;br /&gt;
&lt;br /&gt;
 setarray @array[0], 100, 200, 0, 300, 400, 500, 600;&lt;br /&gt;
 copyarray @array[0], @array[1], [[getarraysize]](@array)-1;  // hidden bug&lt;br /&gt;
Will result in ''@array'' being { 200, 0, 300, 400, 500, 500, 600 } rather than intended { 200, 0, 300, 400, 500, 600, 600 }, because getarraysize returns 6, instead of 7.&lt;br /&gt;
&lt;br /&gt;
[[Category:Script Command]]&lt;/div&gt;</summary>
		<author><name>Nameless2you</name></author>	</entry>

	</feed>