We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi I have this code where I would like to safe the pdf files but don't overwrite them when I restart the program.
This is what I have.
String pdfname = "LineSight.pdf";
void setup(){
teller += 1;
pdfname = "LineSight" + teller + ".pdf";
pdf = (PGraphicsPDF) createGraphics(width, height, PDF, pdfname);
}
void draw(){
Beginrecord()
Endrecord()
}
So mainly what's happening in the setup is what causes it to make different files, but when I restart the program and save again it rewrites the former files.
Answers
I doubt your code works this way (Beginrecord() instead of beginRecord()), but I suppose it is a mockup just showing the base idea, which is a good idea. :-)
Well, there is no easy way to keep the information from one run to the next.
I see two possible ways:
maybe put the date and time in the filename so ensure the filenames are unique.
use yyyymmdd_hhmmss format to preserve the creation order.