Table :FindRows Iteration Error
in
Programming Questions
•
4 months ago
Hi I'm planning to use the Table Class for an Assignment using a csv file
Here is the example code taken from processing.org
but I've found that using FindRows or MatchRows gives me
"can only iterate over an instance of java.lang.iterable " error
At the moment even the example code given doesn't work it gives the same error
I'm using processing 2.0b8.
I'm using processing 2.0b8.
Is the table class still buggy?
Here is the example code taken from processing.org
Table table; void setup() { table = new Table(); table.addColumn("name"); table.addColumn("type"); TableRow newRow = table.addRow(); newRow.setString("name", "Lion"); newRow.setString("type", "Mammal"); newRow = table.addRow(); newRow.setString("name", "Snake"); newRow.setString("type", "Reptile"); newRow = table.addRow(); newRow.setString("name", "Mosquito"); newRow.setString("type", "Insect"); newRow = table.addRow(); newRow.setString("name", "Lizard"); newRow.setString("type", "Reptile"); for (TableRow row : table.findRows("Reptile", "type")) { println(row.getString("name") + ": " + row.getString("type")); } }
1