xxxxxxxxxx
24
let strings = [];
function preload(){
strings = loadStrings("premier_league.csv")
}
function setup() {
createCanvas(500, 400);
background(235);
// Did we succeed to load anything?
if (strings == null) {
print("failed to load the file, stopping here");
// this is an endless loop; it's a common way
// to prevent a program from continuing when
// something is so wrong that there is no sense
// in continuing
while (true) {}
}
print("strings loaded from file successfully, read " + strings.length + "lines"
);
}