We are about to switch to a new forum software. Until then we have removed the registration on this forum.
String[] lines;
int[] linesint;
void setup() {
size(500,500);
String[] line = loadStrings("list.txt");
lines = line;
linesint = int(split(line[0], ENTER));
}
void draw() {
background(255);
fill(0);
for(int i = 0; i<lines.length; i++) {
text(lines[i],(i*50)+50,50);
}
}
void mouseClicked() {
if (mouseY<450) {
linesint[0]++;
lines[0] = ""+linesint[0];
} if (mouseY>450) {
saveStrings("list.txt", lines);
}
}
I'm testing out using text files and I ran into a problem, that being when I run saveStrings() it doesnt place the file in the data folder. This means that it doesnt use the saved file next time I run the program. I want to make a kind of save system being that you use a txt file to save all the variables, but that cant happen when it makes an entirely new txt file every time. Basically, how do you replace files in the data folders?
Answers
saveStrings("data/list.txt", lines);
?My attempt below.
Kf