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

67 lines
978 B
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>sort()</name>
<category>Data</category>
<subcategory>Array Functions</subcategory>
<usage>Web &amp; Application</usage>
<example>
<image></image>
<code>
float a[] = { 3.4, 3.6, 2, 0, 7.1 };
sort(a);
for (int i = 0; i &lt; a.length; i++) {
println(a[i]);
}
</code>
</example>
<example>
<image></image>
<code>
String s[] = { "deer", "elephant", "bear", "apple", "car" };
sort(s);
for (int i = 0; i &lt; s.length; i++) {
println(s[i]);
}
</code>
</example>
<description>
Sorts an array of numbers from smallest to largest and puts an array of words in alphabetical order.
</description>
<syntax>
sort(<c>array</c>)
</syntax>
<parameter>
<label>array</label>
<description>String[], int[], or float[]</description>
</parameter>
<returns></returns>
<related>
reverse()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
<level>Extended</level>
</root>