From deb9e304a1f5835267b906e1732abd2ab0ccb607 Mon Sep 17 00:00:00 2001 From: Daniel Shiffman Date: Sat, 9 Mar 2013 14:22:20 -0500 Subject: [PATCH] adding feature to limit table size to 10 to table example --- .../Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde b/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde index 2e3f2a20e..e8fcc64ae 100644 --- a/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde +++ b/java/examples/Topics/Advanced Data/LoadSaveTable/LoadSaveTable.pde @@ -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");