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.
Page Index Toggle Pages: 1
upgrade? (Read 396 times)
upgrade?
Dec 10th, 2008, 3:52am
 
I recently upgraded to the new processing. I was working on this code it runs perfectly in an older version of processing. However, after I switched versions I am getting an error.

The debugger says
"Syntax error on token(s), misplaced construct(s)"

This is the code I am working with. Thank in advance for any advice you can give.


String[] lines;
int index = 0;

void setup() {
 
 size(200, 200);
 background(0);
 stroke(255);
 frameRate(12);
 lines = loadStrings("pos.csv");
 
}

void draw() {
 println(lines);
   if (index == lines.length) {
   index = 0;
   lines = loadStrings("pos.csv");
    println("restart");
 }
 if (index < lines.length) {
   String[] pieces = split(lines[index], ',');
   if (pieces.length == 2) {
     int x = int(pieces[0]) ;
     int y = int(pieces[1]) ;
     point(x, y);
   }
   // Go to the next line for the next run through draw()
   index = index + 1;
 }

}
Re: upgrade?
Reply #1 - Dec 10th, 2008, 1:07pm
 
I can't reproduce the error with Processing 1.0.1 (replacing lines loading by a hard-coded init).
Perhaps copy-paste the code in a new sketch?
Re: upgrade?
Reply #2 - Dec 10th, 2008, 7:12pm
 
i guess you are on xp and are double-clicking the .pde file to open it. check if your windows title bar shows the sketch name with a tilde (~) or otherwise misspelled. if so you ran into bug #1089. just open the file via "file -> open" from the menu then it should run fine.

F
Page Index Toggle Pages: 1