We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Problems with loadStrings()
Page Index Toggle Pages: 1
Problems with loadStrings() (Read 523 times)
Problems with loadStrings()
Feb 13th, 2010, 2:45pm
 
Simple little annoyance here.
Code:
public String words[] = loadStrings("Dict.txt"); 


Which gives error:
Code:
The file "Dict.txt" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable. 


Dict.txt is in the data folder of the sketch, and saved with UTF-8 format.
My question is, why am I getting this error, and how can I fix it? Undecided

Please help,

HiGuy
Re: Problems with loadStrings()
Reply #1 - Feb 14th, 2010, 1:30am
 
Let me guess (as it is a common error...).
You declared this line above setup().
All loadXxx() stuff must be in setup() (or draw() but then should be conditional to avoid loading on each frame) because before that (at global variables init time) the data folder location isn't known.
Page Index Toggle Pages: 1