<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.trainzsimulator.com/index.php?action=history&amp;feed=atom&amp;title=Arrays</id>
	<title>Arrays - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.trainzsimulator.com/index.php?action=history&amp;feed=atom&amp;title=Arrays"/>
	<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;action=history"/>
	<updated>2026-11-05T09:20:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=18605&amp;oldid=prev</id>
		<title>Builderbob: Categories</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=18605&amp;oldid=prev"/>
		<updated>2019-04-24T00:53:58Z</updated>

		<summary type="html">&lt;p&gt;Categories&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:53, 24 April 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l188&quot;&gt;Line 188:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 188:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See Also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=Categories=&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:TrainzScript]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Builderbob</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=8939&amp;oldid=prev</id>
		<title>Trev999 at 17:24, 14 June 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=8939&amp;oldid=prev"/>
		<updated>2016-06-14T17:24:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:24, 14 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  words[3] = &amp;quot;sentences&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  words[3] = &amp;quot;sentences&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  objects[0] = me;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  objects[0] = me;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  myObjects[2] = Router&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/del&gt;GetGameObject(&quot;my sibling&quot;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  myObjects[2] = Router&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;GetGameObject(&quot;my sibling&quot;);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{MethodHeader|Array Methods}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{MethodHeader|Array Methods}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Trev999</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=1684&amp;oldid=prev</id>
		<title>Marinus at 00:10, 31 October 2010</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=1684&amp;oldid=prev"/>
		<updated>2010-10-31T00:10:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:10, 31 October 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l116&quot;&gt;Line 116:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 116:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{MethodHeader|copy()}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{anchor|copy}}&lt;/ins&gt;{{MethodHeader|copy()}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;#039;&amp;#039;copy()&amp;#039;&amp;#039; creates a duplicate of the array, the syntax is:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;#039;&amp;#039;copy()&amp;#039;&amp;#039; creates a duplicate of the array, the syntax is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Marinus</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=144&amp;oldid=prev</id>
		<title>Windwalkr: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=144&amp;oldid=prev"/>
		<updated>2010-02-03T13:58:22Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:58, 3 February 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Windwalkr</name></author>
	</entry>
	<entry>
		<id>https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=143&amp;oldid=prev</id>
		<title>Andi06: /* Array Operators */</title>
		<link rel="alternate" type="text/html" href="https://wiki.trainzsimulator.com/index.php?title=Arrays&amp;diff=143&amp;oldid=prev"/>
		<updated>2009-04-01T17:47:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Array Operators&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Declaration, Initialisation &amp;amp; Population==&lt;br /&gt;
*Arrays need to be declared and initialised before they can be accessed, and it will usually be necessary to populate the array with meaningful data.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|Declaration}}&lt;br /&gt;
*A declaration reserves memory for the variable and allocates a name for that particular array.  This is analogous to a housing developer buying a site and reserving it for future construction.&lt;br /&gt;
&lt;br /&gt;
*To declare an array you must first define the type of object which the array will contain, followed by opening and closing square braces and the name you will use to reference the array variable.&lt;br /&gt;
&lt;br /&gt;
*Just as residential developments can consist of any building type, arrays can consist of almost any class, including classes which you have defined yourself.&lt;br /&gt;
&lt;br /&gt;
 Vehicle[] vehicles;&lt;br /&gt;
 int[] numberList;&lt;br /&gt;
 string[] words;&lt;br /&gt;
 GameObject[] objects;&lt;br /&gt;
 MyOwnClass[] myObjects;&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|Initialisation}}&lt;br /&gt;
*In the same way that a developer must decide how many units he wants to build, you must decide how many members your array will initially be able to contain.  You will be able to make the array larger or smaller later, for now you are just setting the initial size.&lt;br /&gt;
*To initialise the array you use the keyword new, followed by the class of object that the array is to contain and the initial number of members in square brackets.&lt;br /&gt;
&lt;br /&gt;
 vehicles = new Vehicle[5];&lt;br /&gt;
 numberList = new int[10];&lt;br /&gt;
 words = new string[2];&lt;br /&gt;
 objects = new GameObject[3];&lt;br /&gt;
 myObjects = new MyOwnClass[7];&lt;br /&gt;
&lt;br /&gt;
*It is possible, and often convenient, to declare and initialise the array in a single statement:&lt;br /&gt;
&lt;br /&gt;
 Vehicle[] vehicles = new Vehicle[5];&lt;br /&gt;
 int[] numberList = new int[10];&lt;br /&gt;
 string[] words = new string[2];&lt;br /&gt;
 GameObject[] objects = new GameObject[3];&lt;br /&gt;
 MyOwnClass[] myObjects = new MyOwnClass[7];&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|Population}}&lt;br /&gt;
*We now have a plot of land and some completed buildings but it will still be meaningless to call at an individual house because no-one will be living there.&lt;br /&gt;
&lt;br /&gt;
*You can populate the individual elements by assigning a value to an indexed position in the array. The syntax for this is:&lt;br /&gt;
&lt;br /&gt;
 vehicles[0] = GetMyTrain().GetVehicles[3];&lt;br /&gt;
 numberList[0] = 0;&lt;br /&gt;
 words[3] = &amp;quot;sentences&amp;quot;&lt;br /&gt;
 objects[0] = me;&lt;br /&gt;
 myObjects[2] = Router,GetGameObject(&amp;quot;my sibling&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|Array Methods}}&lt;br /&gt;
*A further shortcut is to use a method which returns an array to initialise and populate your array in a single statement.  Often the same statement can also contain the declaration:&lt;br /&gt;
&lt;br /&gt;
 Vehicle[] vehicles = World.GetVehicleList();&lt;br /&gt;
 int[] numberList = GetNumberList(1,10);&lt;br /&gt;
 string[] words = Str.Tokens(&amp;quot;comma,separated,list&amp;quot;,&amp;quot;,&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
*You can write your own methods to return arrays:&lt;br /&gt;
&lt;br /&gt;
 int[] GetNumberList(int start, int count) {&lt;br /&gt;
   int[] result = new int[0];&lt;br /&gt;
   int i;&lt;br /&gt;
   for (i = start; i &amp;lt; count; i++) {&lt;br /&gt;
     result[result.size()] = i;&lt;br /&gt;
   }&lt;br /&gt;
   return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Array Operators==&lt;br /&gt;
{{MethodHeader|Appending to an Array}}&lt;br /&gt;
*This is a syntax which allows you to increase the size of a properly initialised array by adding a new member to the end. Since array indexing starts at zero, the last member will always be &amp;#039;&amp;#039;array[array.size() - 1]&amp;#039;&amp;#039;.  &lt;br /&gt;
&lt;br /&gt;
*Trying to read from &amp;#039;&amp;#039;array[array.size()]&amp;#039;&amp;#039; will result in a range error because you are attempting to access a location which does not exist.&lt;br /&gt;
&lt;br /&gt;
*Assigning to &amp;#039;&amp;#039;array[array.size()]&amp;#039;&amp;#039; however, will create a new member and increment the number of items in the array.&lt;br /&gt;
&lt;br /&gt;
 vehicles[vehicles.size()] = me;&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|Indexing}}&lt;br /&gt;
*A subscript enclosed in square brackets serves to define an individual item within an array.  The notation will only be meaningful if that particular item has a value assigned. Assuming that this is the case when it isn&amp;#039;t is a common error, and one that can be very difficult to find.&lt;br /&gt;
&lt;br /&gt;
*Given these statements:&lt;br /&gt;
&lt;br /&gt;
 int[] numbers = new int[3];&lt;br /&gt;
 numbers[0] = 0;&lt;br /&gt;
 numbers[2] = 2;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;numbers[0]&amp;#039;&amp;#039; will return zero as an integer&lt;br /&gt;
*&amp;#039;&amp;#039;numbers[2]&amp;#039;&amp;#039; will return the value 2&lt;br /&gt;
*&amp;#039;&amp;#039;numbers[1]&amp;#039;&amp;#039; however will return null since no value has been assigned to that particular item.&lt;br /&gt;
&lt;br /&gt;
*Array indexing starts at zero (don&amp;#039;t ask why) and finishes at &amp;#039;&amp;#039;array.size() - 1&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|Range Indexing}}&lt;br /&gt;
*Whilst it is straightforward to erase a value from an array by assigning it to null, this doesn&amp;#039;t affect the size of the array itself.&lt;br /&gt;
&lt;br /&gt;
*Given these statements:&lt;br /&gt;
&lt;br /&gt;
 int[] numbers = new int[3];&lt;br /&gt;
 numbers[0] = 0;&lt;br /&gt;
 numbers[1] = 1;&lt;br /&gt;
 numbers[2] = 2;&lt;br /&gt;
&lt;br /&gt;
*Making the assignment &amp;#039;&amp;#039;numbers[2] = null&amp;#039;&amp;#039; will clear out the value but the array will still contain 3 items.&lt;br /&gt;
&lt;br /&gt;
*You can delete items and reduce the size of the array at the same time by specifying a range index like this:&lt;br /&gt;
&lt;br /&gt;
 numbers[0,1] = null;&lt;br /&gt;
&lt;br /&gt;
*The first index is the position of the item to remove and the second is one greater than the position of the last item.&lt;br /&gt;
&lt;br /&gt;
 numbers[0,1] = null removes the first item&lt;br /&gt;
 numbers[2,3] = null removes the last item&lt;br /&gt;
&lt;br /&gt;
*Array range indexing is an important tool for use with strings (which are really arrays of characters)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|size()}}&lt;br /&gt;
*&amp;#039;&amp;#039;array.size()&amp;#039;&amp;#039; returns a count of the items in the array, this is no guarantee that all of the items have a value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{MethodHeader|copy()}}&lt;br /&gt;
*&amp;#039;&amp;#039;copy()&amp;#039;&amp;#039; creates a duplicate of the array, the syntax is:&lt;br /&gt;
&lt;br /&gt;
 int[] old = new int[3];&lt;br /&gt;
 int[] new;&lt;br /&gt;
 new.copy(old);&lt;br /&gt;
&lt;br /&gt;
*There is a subtle difference between copying an array and creating a duplicate reference to it by assignment.  In the case above, the array &amp;#039;&amp;#039;new&amp;#039;&amp;#039; is an entirely separate variable from the array &amp;#039;&amp;#039;old&amp;#039;&amp;#039;. Changing the values of one will not affect the other.&lt;br /&gt;
&lt;br /&gt;
 int[] old = new int[3];&lt;br /&gt;
 int[] new;&lt;br /&gt;
 new = old;&lt;br /&gt;
&lt;br /&gt;
*will produce a similar result at first glance, but in this case assigning a new value to &amp;#039;&amp;#039;new[1]&amp;#039;&amp;#039; will also change the value of &amp;#039;&amp;#039;old[1]&amp;#039;&amp;#039;. This is because the assignment effectively creates an alternative name for the same data.&lt;br /&gt;
&lt;br /&gt;
==Code Samples==&lt;br /&gt;
{{MethodHeader|Array Handling Methods}}&lt;br /&gt;
*These are example routines which carry out some basic operations on string arrays, all the routines are case sensitive.  They can be used for other object types with appropriate modification.&lt;br /&gt;
&lt;br /&gt;
*Member returns true if the string &amp;#039;s&amp;#039; is contained within the array &amp;#039;strings&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
 public bool Member(string[] strings, string s) {&lt;br /&gt;
   int n;&lt;br /&gt;
   bool result = false;&lt;br /&gt;
   if (strings.size() == 0) {return result;}&lt;br /&gt;
   for (n = 0; n &amp;lt; strings.size(); n++) {&lt;br /&gt;
     if (s == strings[n]) {&lt;br /&gt;
       result = true;&lt;br /&gt;
       break;&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
   return result;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
*Add will append string &amp;#039;s&amp;#039; to the end of the array &amp;#039;strings&amp;#039; as long as &amp;#039;s&amp;#039; is not already present.&lt;br /&gt;
&lt;br /&gt;
 public void Add(string[] strings, string s) {&lt;br /&gt;
   if (Member(strings,s)) return;&lt;br /&gt;
   else {strings[strings.size()] = s;}&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
*Remove will delete any instance of string &amp;#039;s&amp;#039; from the array and reduce the size of the array accordingly.&lt;br /&gt;
&lt;br /&gt;
 public void Remove(string[] strings, string s) {&lt;br /&gt;
   int n;&lt;br /&gt;
   if (strings.size() == 0) return;&lt;br /&gt;
   for (n = 0; n &amp;lt; strings.size(); n++) {&lt;br /&gt;
     if (s == strings[n]) {strings[n,n+1] = null;}&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
*Sort will perform a case sensitive alpha sort of the strings in the array. This is a flagged bubble sort, simple but slow, and is fine for most small arrays.  For large arrays you should write your own quicksort method.&lt;br /&gt;
&lt;br /&gt;
 public void Sort(string[] strings) {&lt;br /&gt;
   int x,y;&lt;br /&gt;
   string temp;&lt;br /&gt;
   bool flag;&lt;br /&gt;
   for (x = 0; x &amp;lt; strings.size(); x++) {&lt;br /&gt;
     flag = false;&lt;br /&gt;
     for (y = 0; y &amp;lt; strings.size() - 1; y++) {&lt;br /&gt;
       if (strings[y] &amp;gt; strings[y + 1]) {&lt;br /&gt;
         temp = strings[y + 1];&lt;br /&gt;
         strings[y + 1] = strings[y];&lt;br /&gt;
         strings[y] = temp;&lt;br /&gt;
         flag = true;&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
     if (!flag) break;&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;/div&gt;</summary>
		<author><name>Andi06</name></author>
	</entry>
</feed>