Files
processing4/web/reference/API/arrayaccess.xml
2005-01-27 06:48:42 +00:00

67 lines
1.2 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>[] (array access)</name>
<category>Structure</category>
<subcategory></subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] numbers = new int[3];
numbers[0] = 90;
numbers[1] = 150;
numbers[2] = 30;
int a = numbers[0] + numbers[1]; // Sets variable a to 240
int b = numbers[1] + numbers[2]; // Sets variable b to 180
</code>
</example>
<description>
The array access operator is used to specify a location within an array. The data at this location can be defined with the syntax <b>array[element] = value</b> or read with the syntax <b>value = array[element]</b>.
</description>
<syntax>
<c>datatype</c>[]
<c>array</c>[<c>element</c>]
</syntax>
<parameter>
<label>datatype</label>
<description>any primitive or compound datatype, including user defined classes</description>
</parameter>
<parameter>
<label>array</label>
<description>any valid variable name</description>
</parameter>
<parameter>
<label>element</label>
<description>int: must not exceed the length of the array - 1</description>
</parameter>
<returns></returns>
<related>
Array
</related>
<availability>1.0</availability>
<type>Operator</type>
<partof>PDE</partof>
</root>