FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Bugs
   Bug Fixes, Implemented Suggestions
(Moderator: fry)
   'Semantic Error' class not found v0065
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: 'Semantic Error' class not found v0065  (Read 817 times)
depth

WWW Email
'Semantic Error' class not found v0065
« on: Oct 13th, 2003, 4:41am »

i feel like this is something that has fer sure been noticed before, but an intensive forum search turned up nothing for me.
 
i just updated from 0056(yipe!) to 0065.  some code i wrote in 0056, with a class called 'Ripple', no longer works.  i tried cutting and pasting the .pde code to a completely new file, in case it was some sort of issue with premade class files, but no luck...
 
here's the error message:
: Semantic Error: Type Ripple was not found.C:/Program Files/proce55ing/processing-0065/lib/build/Temporary_1285_7441.java:20:1 7:20:22: Semantic Error: A candidate for type "Ripple" was found, but it is invalid and needs to be fixed before this type will successfully compile.
 
thx
-depth
 
arielm

WWW
Re: 'Semantic Error' class not found v0065
« Reply #1 on: Oct 13th, 2003, 10:06am »

is it possible to see the code?
 

Ariel Malka | www.chronotext.org
depth

WWW Email
Re: 'Semantic Error' class not found v0065
« Reply #2 on: Oct 13th, 2003, 9:32pm »

sure.  i haven't been able to update all the post-v60 stuff cause the compiler can't get past the class error, so i'm sure there are other issues as well.  could be one of those other issues that is causing the class problem.
 
here it is:
 
Ripple[] ripples;
int numRipples = 0;
int maxRipples;
float growSpeed = 1.05;
float spinSpeed = .03;
float masterSpin = 0;
int rippleFreq = 1;
int counterMain = 0;
boolean begin = false;
int lastX;
int lastY;
 
void setup(){
  size(800, 400);
  background(0);
  ellipseMode(CENTER_DIAMETER);
  noFill();
   
  maxRipples = (int)(width);
  ripples = new Ripple[maxRipples];
};
 
void loop(){
  if (!begin){ return; };
   
  if (counterMain%rippleFreq == 0){
    int thisX = (int)((lastX - mouseX)*.05);
    int thisY = (int)((lastY - mouseY)*.05);
    ripples[numRipples%maxRipples] = new Ripple(numRipples, lastX, lastY);
    numRipples++;
  };
   
  int iLen = max(0, (numRipples-maxRipples));
  for (int i=numRipples-1; i>=iLen; i--){
    ripples[i%maxRipples].update();
  };
   
  counterMain++;
  masterSpin += spinSpeed;
  lastX = mouseX;
  lastY = mouseY;
};
 
void mouseMoved(){
  begin = true;
};
 
class Ripple {
  int num;  //index in ripples[]
  int x;  //x center of ripple
  int y;  //y center of ripple
  float rad = 50;  //radius of ripple
  float rot = 0;
  boolean alive = true;
 
  Ripple (int _num, int _x, int _y){
    num = _num;
    x = _x;
    y = _y;
  };
   
  void update(){
    if(!alive){ return; };
    grow();
    move();
    spin();
    drawIt();
    checkSize();
  };
 
  void grow(){
    rad *= growSpeed;
  };
 
  void move(){
    //ease ripple center toward center of screen
    x += (width/2 - x)*growSpeed*.005;
    y += (height/2 - y)*growSpeed*.005;
  };
   
  void spin(){
    rot += spinSpeed;
  };
   
  void checkSize(){
    if (rad > 2*width){
 alive = false;
    };
  };
   
  void drawIt(){
    int depth = (int)sq(40*rad/width);
    stroke(depth+50, depth/15, depth/20);
    push();
 translate(x, y);
 rotateZ(rot+masterSpin);
 ellipse(0, 0, rad, rad*.7);
    pop();
  };
 
  void kill(){
    //why doesn't this work?
    ripples[num] = null;
  };
 
};
 
}
 
arielm

WWW
Re: 'Semantic Error' class not found v0065
« Reply #3 on: Oct 14th, 2003, 1:55am »

after removing the last bracket and pasting into eclipse: it works.
 
still not with processing,
 
but when removing the useless semi-colons after each class and method blocks, it works...
 
i guess the semi-colons after these blocks are tolerated in pure java, but not by processing's prepocessor (not a very critical bug i guess...)
 
here is our kosherized piece of code:
Code:

Ripple[] ripples;
int numRipples = 0;
int maxRipples;
float growSpeed = 1.05;
float spinSpeed = .03;
float masterSpin = 0;
int rippleFreq = 1;
int counterMain = 0;
boolean begin = false;
int lastX;
int lastY;
 
void setup(){
  size(800, 400);
  background(0);
  ellipseMode(CENTER_DIAMETER);
  noFill();
 
  maxRipples = (int)(width);
  ripples = new Ripple[maxRipples];
}
 
void loop(){
if (!begin){ return; };
 
  if (counterMain%rippleFreq == 0){
    int thisX = (int)((lastX - mouseX)*.05);
    int thisY = (int)((lastY - mouseY)*.05);
    ripples[numRipples%maxRipples] = new Ripple(numRipples, lastX, lastY);
    numRipples++;
  }
 
  int iLen = max(0, (numRipples-maxRipples));
  for (int i=numRipples-1; i>=iLen; i--){
    ripples[i%maxRipples].update();
  }
 
  counterMain++;
  masterSpin += spinSpeed;
  lastX = mouseX;
  lastY = mouseY;
}
 
void mouseMoved(){
  begin = true;
}
 
class Ripple {
  int num;  //index in ripples[]
  int x;  //x center of ripple
  int y;  //y center of ripple
  float rad = 50;  //radius of ripple
  float rot = 0;
  boolean alive = true;
 
  Ripple (int _num, int _x, int _y){
    num = _num;
    x = _x;
    y = _y;
  }
 
  void update(){
  if(!alive){ return; };
    grow();
    move();
    spin();
    drawIt();
    checkSize();
  }
 
  void grow(){
    rad *= growSpeed;
  }
 
  void move(){
    //ease ripple center toward center of screen
    x += (width/2 - x)*growSpeed*.005;
    y += (height/2 - y)*growSpeed*.005;
  }
 
  void spin(){
    rot += spinSpeed;
  }
 
  void checkSize(){
    if (rad > 2*width){
 alive = false;
    }
  }
 
  void drawIt(){
    int depth = (int)sq(40*rad/width);
    stroke(depth+50, depth/15, depth/20);
    push();
    translate(x, y);
    rotateZ(rot+masterSpin);
    ellipse(0, 0, rad, rad*.7);
    pop();
  }
 
  void kill(){
    //why doesn't this work?
    ripples[num] = null;
  }
}
 

Ariel Malka | www.chronotext.org
fry


WWW
Re: 'Semantic Error' class not found v0065
« Reply #4 on: Oct 14th, 2003, 10:33pm »

yeah, this is a preprocessor bug with extra semicolons. it will also cause trouble with two ;; next to one another. dan is looking into it.
 
depth

WWW Email
Re: 'Semantic Error' class not found v0065
« Reply #5 on: Oct 15th, 2003, 5:36pm »

excellent.  thanks ariel.  i guess i need to ease up on the semicolon fetish....
 
fry


WWW
Re: 'Semantic Error' class not found v0065
« Reply #6 on: Oct 18th, 2003, 7:28pm »

i think dan's got a fix for the semicolon bug in there, so that should be repaired for the forthcoming 66.
 
Pages: 1 

« Previous topic | Next topic »