You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My program is getting hung at preload(), evident by the fact that my sketch only shows "Loading..." now. It was working one minute and then the next, it can't get past "Loading...". I added 2 lines into the 1st .csv file, following the same format (commas between elements). In the preload(), I am using loadStrings() to load 2 csv files into a variable. The 1st file has 35 lines, and the 2nd has 7 lines, and each line is no longer than about 15 characters (so the .csv files are not big at all).
I found that renaming the 2 .csv files from 'Food.csv' -> 'food.csv' & 'Drink.csv' -> 'drink.csv' and updating the file names in preload() allowed the sketch to get past the hang in preload().
BUT, after editing the food.csv file (removing the 2 lines I added earlier), it hanged again in preload().
Solution:
This time I changed .csv to .txt files and the sketch works again (does NOT hang in preload()), and I can edit the .txt files without a problem. EDIT:
After altering the 2nd .txt file, the program hangs again at preload()
2nd EDIT:
instead of loadStrings('food.txt'), I added a "/" to make it loadStrings('/food.txt') and it apparently doesn't hang???
loadStrings('food.txt') --> loadStrings('/food.txt')
loadStrings('drink.txt') --> loadStrings('/drink.txt')
So there seems to be a problem with the handling of a .csv file if it has been altered after initially being run in the sketch,
i.e. run a sketch where the .csv is inputted via loadStrings() in preload(), sketch runs without issue, stop the sketch, edit the .csv file, run the sketch, sketch hangs at preload()
Web browser and version: Google Chrome Version 65.0.3325.181
Operating System: Windows 10 Home, 64-bit
The text was updated successfully, but these errors were encountered:
It seems like there might be multiple issues here so I'm gonna try to break it down:
It seems like loading files (specifically CSVs maybe?) that begin with a capital letter doesn't work
it seems like adding a "/" to the front fixes the issue for non-CSVs
with the "/" and non-capital name, the issue still occurs when you load a CSV via loadStrings() in preload(), then edit it, and then run the sketch again
Nature of issue?
Details about the bug:
My program is getting hung at preload(), evident by the fact that my sketch only shows "Loading..." now. It was working one minute and then the next, it can't get past "Loading...". I added 2 lines into the 1st .csv file, following the same format (commas between elements). In the preload(), I am using loadStrings() to load 2 csv files into a variable. The 1st file has 35 lines, and the 2nd has 7 lines, and each line is no longer than about 15 characters (so the .csv files are not big at all).
I found that renaming the 2 .csv files from 'Food.csv' -> 'food.csv' & 'Drink.csv' -> 'drink.csv' and updating the file names in preload() allowed the sketch to get past the hang in preload().
BUT, after editing the food.csv file (removing the 2 lines I added earlier), it hanged again in preload().
Solution:This time I changed .csv to .txt files and the sketch works again (does NOT hang in preload()), and I can edit the .txt files without a problem.
EDIT:After altering the 2nd .txt file, the program hangs again at preload()
2nd EDIT:
instead of loadStrings('food.txt'), I added a "/" to make it loadStrings('/food.txt') and it apparently doesn't hang???
loadStrings('food.txt') --> loadStrings('/food.txt')
loadStrings('drink.txt') --> loadStrings('/drink.txt')
So there seems to be a problem with the handling of a .csv file if it has been altered after initially being run in the sketch,
i.e. run a sketch where the .csv is inputted via loadStrings() in preload(), sketch runs without issue, stop the sketch, edit the .csv file, run the sketch, sketch hangs at preload()
The text was updated successfully, but these errors were encountered: