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 › refresh the loadstring
Page Index Toggle Pages: 1
refresh the loadstring (Read 145 times)
refresh the loadstring
Mar 24th, 2009, 12:00pm
 
Hello!

I am using processing to load data from a web-page and output to the serial port. Now if I add new content to the web-page it takes several minutes before processing gets aware of the new content. I wonder how one could make this loadString more immediate (i.e. by refreshing the loadString...)
 
Here is part of my fishy code:

 String lines[] = loadStrings("http://urbanmyst.wordpress.com/");
 newValue = lines.length;
 if (newValue > oldValue){
   myPort.write('H');
   for (int i=0; i < lines.length; i++) {
   println(lines[i]);
   }
   println("Value increased!");
   print(newValue);
   oldValue = lines.length;
Page Index Toggle Pages: 1