« expecting SEMI, found ‘p’ » but the SEMI is here...

Hi,

For a personal project, I’d like to use this interface and custom it : 
https://www.openprocessing.org/sketch/423991

Then, I copied/pasted the content of the 4 tabs in a new P3 document (I tried P2 too ;) ) but I have an error message « expecting SEMI, found ‘p’ ». 
As you can see, there is a semi at the line 1…



What do I fail ? (P.S. I am a newbie :) )

Capture d’écran 2017-06-02 à 10.54.05

Tagged:

Answers

  • It is unlikely you will need a closing curley brace (}) on line 1.

  • edited June 2017

    Hi TfGuy44,

    This screen is the step 2, I added a "}" on line one because of this error message :)

    It was strange but I did it and the error message desapeared. Do you understand something ? I don't...

  • This is the step 1, before the "}" on line 1 : Capture d’écran 2017-06-02 à 11.58.59

  • line 7 has a spare }

  • ctrl-t in the editor is good at debugging this.

    posting images of code is generally not helpful.

  • edited June 2017

    Sorry, I'm a newbie ;)

    This is the original code :

    var p = [];
    
    function setup() {
      createCanvas(windowWidth*2/3, windowHeight/2);
      background(40);
      colorMode(HSB, 360, 100, 100, 100);
      mid = createVector(width*2/3, height/2);
      for (var i = 0; i <= 100; i++) {
        p.push(new Particle());
      }
      setupInterface();
    }
    
    function draw() {
      drawInterface();
      for (var i = 0; i < p.length; i++) {
        p[i].update();
        for (var j = 0; j < p.length; j++) {
          if ( i != j) {
            p[i].check(p[j]);
          }
        }
      }
    }
    

    And the error message is still "Missing right curly bracket "}" but now on line 4 I checked the curly brackets and everything seems to be ok... Maybe it's friday for Processing too...

  • I notice in your screenshot your mode is java. You should switch your mode to p5.js

    Kf

Sign In or Register to comment.