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 & HelpIntegration › loadStrings() + applet problems
Page Index Toggle Pages: 1
loadStrings() + applet problems (Read 1323 times)
loadStrings() + applet problems
Jul 14th, 2005, 10:59am
 
Hello everybody!

I searched the BETA as well as the ALPHA board but I couldn't find anything that's useful:

I have an applet which should load data from (now) a .txt file (later php generated text file based on MySQL database).

As far as I know (and as it worked in a previous applet) I need to type the complete URL to the folder where the applet and the data is located. However, this doesn't work.

Could maybe tell me, if I have to write (applet and files are in the "appletfolder")

Code:
loadStrings("http://mywebsite.com/appletfolder/textfile.txt"); 


or
Code:
loadStrings("/appletfolder/textfile.txt"); 


or
Code:
loadStrings("textfile.txt"); 


or has the txt file to be in a data subdirectory:
Code:
loadStrings("data/textfile.txt"); 


or
Code:
loadStrings("http://mywebsite.com/appletfolder/data/textfile.txt"); 



?

Maybe this information is important, too: loadStrings() is done by a thread (the thread manages all loading in the background in order to keep motion fluid).

the whole applet is (or should be) in an earlier version (added various features, everything running if in the PDE) available at http://www.esoptera.net/map2pre/


thank you for any help

fab
Re: loadStrings() + applet problems
Reply #1 - Jul 14th, 2005, 10:09pm
 
Well, I tested a bit more today. This code worked quite well on localhost:

Code:
loadStrings("http://mywebsite.com/appletfolder/textfile.txt"); 



But on my webspace, it still didn't work. Taking a look at opera's java console I realized that one text file has an upper case ("isImage.txt") but when uploading, it becomes a lower case...

In other words: this "problem" is solved.

thanks for your time reading this!

greetings

fab
Re: loadStrings() + applet problems
Reply #2 - Jul 15th, 2005, 4:35pm
 
Damn I bet that was a pain to figure out! I was a bit concerned when I first saw your post and presumed that maybe processing couldn't load in text/string data from a dynamic webserver - I'm hoping to use that feature to save data on a database for a few of my future applets/projects.
Page Index Toggle Pages: 1