forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTable_addRow.xml
More file actions
46 lines (36 loc) · 1.37 KB
/
Table_addRow.xml
File metadata and controls
46 lines (36 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>addRow()</name>
<category>Table</category>
<subcategory>Method</subcategory>
<type>method</type>
<example>
<code><![CDATA[
def setup():
table = Table()
table.addColumn("name")
table.addColumn("type")
newRow = table.addRow()
newRow.setString("name", "Lion")
newRow.setString("type", "Mammal")
print(table.getRowCount()) # Prints 1
table.addRow() # Creates a blank row
print(table.getRowCount()) # Prints 2
table.addRow(newRow) # Duplicates newRow
print(table.getRowCount()) # Prints 3
]]></code>
</example>
<description><![CDATA[
Use <b>addRow()</b> to add a new row of data to a <b>Table</b> object. By default, an empty row is created. Typically, you would store a reference to the new row in a <b>TableRow</b> object (see <b>newRow</b> in the example above), and then set individual values using <b>setInt()</b>, <b>setFloat()</b>, or <b>setString()</b>. If a <b>TableRow</b> object is included as a parameter, then that row is duplicated and added to the table.
]]></description>
<syntax>
.addRow()
.addRow(source)
</syntax>
<parameter>
<label>source</label>
<description><![CDATA[TableRow: a reference to the original row to be duplicated]]></description>
</parameter>
<related>Table_removeRow</related>
<related>Table_clearRows</related>
</root>