Okay, so I defined all the things, and it looks like this:
int sessionhs = 0;
String shs = nf(sessionhs);
String[] hs;
String[] lasths;
String ahs1;
int ahs;
void setup() {
size(1920, 1080);
lasths = loadStrings("hs.txt");
}
void draw() {
ahs1 = (lasths[0]);
int ahs = int(ahs1);
if (sessionhs > ahs) {
hs[0] = ahs1;
saveStrings("hs.txt", hs);
}
}
However, with the .txt file present, I get this error message:
ArrayIndexOutOfBoundsException: 0