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

62 lines
1.1 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>expand()</name>
<category>Data</category>
<subcategory>Array Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
int[] ia = {0, 1, 3, 4};
println(ia.length); // Prints "4"
ia = expand(ia);
println(ia.length); // Prints "8"
ia = expand(ia, 512);
println(ia.length); // Prints "512"
</code>
</example>
<description>
Increases the size of an array. By default, this function doubles the size of the array, but the optional <b>newSize</b> parameter provides precise control over the increase in size.
</description>
<syntax>
expand(<c>array</c>)
expand(<c>array</c>, <c>newSize</c>)
</syntax>
<parameter>
<label>array</label>
<description>booleans[], bytes[], chars[], ints[], floats[], or Strings[]</description>
</parameter>
<parameter>
<label>newSize</label>
<description>positive int: new size for the array</description>
</parameter>
<returns>Array (the same datatype as the input)</returns>
<related>
contract()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>