Syntax error with void setup and draw functions

void setup() {
  size(200, 200);
  rectMode(CENTER);
  noStroke();
  fill(0, 102, 153, 204);
}
void draw() {
  background(255);
  rect(width-mouseX, height-mouseY, 50, 50);
  rect(mouseX, mouseY, 50, 50);
} 

I keep getting the same error stating syntax error - missing operator, semicolon or curly brace. Using processing 4.1.1 on a mac and any functions with void setup and/or draw do not happen to work. Some help please?

Hi @vinnyvin,

Welcome to the forum.
At first glance, your code looks ok.

Maybe you can try to…

  • create a new empty sketch
  • check if you are in java mode

… and see if the issue is persistent.

If it persists you can maybe upload a screenshot which shows your PDE window and the error.

Cheers
β€” mnse

Thanks Mnse, I have created various sketches using Void setup and draw and have faced the same issue. I do appear to be in Java mode.

Please see screenshot above.

Thanks in advance.

Move your code to tab 1 and delete tab 2?

1 Like

That has fixed it! Thanks~

1 Like