FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

adding feature to limit table size to 10 to table example · pif/processing@8d13fa1 · GitHub

Repository navigation

Commit 8d13fa1

Browse files
committed
adding feature to limit table size to 10 to table example
1 parent a3b9b74 commit 8d13fa1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ void mousePressed() {
6969
row.setFloat("y", mouseY);
7070
row.setFloat("diameter", random(40, 80));
7171
row.setString("name", "Blah");
72+
73+
// If the table has more than 10 rows
74+
if (table.getRowCount() > 10) {
75+
// Delete the oldest row
76+
table.removeRow(0);
77+
}
7278

7379
// Writing the CSV back to the same file
7480
saveTable(table,"data/data.csv");

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL