We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am a newbie, i searched on StackOverflow and in the Processing Forum before post this question. I also read also the common section questions.
I copied/pasted this sketch from the processing site tutorial : https://processing.org/reference/Table.html
void setup() {
table = new Table();
table.addColumn("id");
table.addColumn("species");
table.addColumn("name");
TableRow newRow = table.addRow();
newRow.setInt("id", table.lastRowIndex());
newRow.setString("species", "Panthera leo");
newRow.setString("name", "Lion");
saveTable(table, "data/new.csv");
}
// Sketch saves the following to a file called "new.csv":
// id,species,name
// 0,Panthera leo,Lion
It gives me the following error message "The variable "Table" does not exist".
Sorry if the question is too stupid! :) Thanks in advance
Answers
Is that your complete sketch? You need to declare
table
somewhere:Table table;
. If you're only going to usetable
insetup()
you can add it to line 3:Table table = new Table();
I am an idiot, and i am teaching my self to code.
Thanks @colouredmirrorball for answer me whith your precious time. Now it works :)
Those two statements are contradictory :P
My very first post on this forum was about this problem, I would never have figured it out on my own... Three years of practice later and I can spot such issues in a second! So don't hit yourself over it, programming is an art and proficiency only comes with practice.
Indeed. Idiots don't learn new things - they believe they already know everything.