-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunctions.pde
39 lines (32 loc) · 891 Bytes
/
Functions.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
void setup_table(){
//import java.io.File;
Table table ;
table = loadTable("content/data.csv","header");
for (TableRow row : table.rows()) {
if (row.getInt("id") == 0){
picture_n = row.getInt("value") ;
println("load : picture_n =", picture_n);
}
}
}
void new_table(){
Table table = new Table();
table.addColumn("id");
table.addColumn("name");
table.addColumn("value");
TableRow newRow = table.addRow();
newRow.setInt("id", table.lastRowIndex());
newRow.setString("name", "picture_n");
newRow.setInt("value", 25);
saveTable(table,"data2.csv");
}
void save_table(){
Table table = loadTable("content/data.csv","header");
//print("exit() : picture_n = ",picture_n);
for (TableRow row : table.rows()) {
if (row.getInt("id") == 0){
row.setInt("value",picture_n) ;
}
}
saveTable(table,"content/data.csv");
}