mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 05:39:18 +01:00
adding feature to limit table size to 10 to table example
This commit is contained in:
@@ -69,6 +69,12 @@ void mousePressed() {
|
||||
row.setFloat("y", mouseY);
|
||||
row.setFloat("diameter", random(40, 80));
|
||||
row.setString("name", "Blah");
|
||||
|
||||
// If the table has more than 10 rows
|
||||
if (table.getRowCount() > 10) {
|
||||
// Delete the oldest row
|
||||
table.removeRow(0);
|
||||
}
|
||||
|
||||
// Writing the CSV back to the same file
|
||||
saveTable(table,"data/data.csv");
|
||||
|
||||
Reference in New Issue
Block a user