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

71 lines
1.3 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>print()</name>
<category>Input/Output</category>
<subcategory>Text Output</subcategory>
<usage>IDE</usage>
<example>
<image></image>
<code>
print("begin- ");
float f = 0.3;
int i = 1024;
print("f is " + f + " and i is " + 1024);
String s = " -end";
println(s);
// The above code prints:
// begin- f is 0.3 and i is 1024 -end
</code>
</example>
<example>
<image></image>
<code>
float[] f = { 0.3, 0.4, 0.5 };
print(f);
// The above code prints:
// 0.30.40.5
</code>
</example>
<description>
Writes to the console area of the Processing environment. This is often helpful for looking at the data a program is producing. The companion function <b>println()</b> works like <b>print()</b>, but creates a new line of text for each call to the function. Individual elements can be separated with quotes ("") and joined with the addition operator (+) except when printing array data.
</description>
<syntax>
print(<c>data</c>)
</syntax>
<parameter>
<label>data</label>
<description>boolean, byte, char, color, int, float, String, boolean[], byte[], char[], color[], int[], float[], or String[]</description>
</parameter>
<returns></returns>
<related>
println()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>