Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preload() hangs after altering .csv file #620

Open
1 of 3 tasks
pj-89 opened this issue Apr 20, 2018 · 1 comment
Open
1 of 3 tasks

preload() hangs after altering .csv file #620

pj-89 opened this issue Apr 20, 2018 · 1 comment

Comments

@pj-89
Copy link

pj-89 commented Apr 20, 2018

Nature of issue?

  • Found a bug
  • Existing feature enhancement
  • New feature request

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()

  • Web browser and version: Google Chrome Version 65.0.3325.181
  • Operating System: Windows 10 Home, 64-bit
@catarak
Copy link
Member

catarak commented Apr 30, 2018

It seems like there might be multiple issues here so I'm gonna try to break it down:

  1. It seems like loading files (specifically CSVs maybe?) that begin with a capital letter doesn't work
  2. it seems like adding a "/" to the front fixes the issue for non-CSVs
  3. 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

I'm going to see if I can reproduce this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants