# Syntax error with void setup and draw functions

**URL:** <https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508>\
**Category:** Beginners\
**Created:** [January 8, 2023, 9:53am UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508 "2023-01-08T09:53:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinnyvin](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vinnyvin](https://discourse.processing.org/u/vinnyvin)\
**Post date:** [January 8, 2023, 9:53am UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508/1 "2023-01-08T09:53:21Z")

</div>

```auto
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?

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [January 8, 2023, 10:49am UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508/2 "2023-01-08T10:49:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vinnyvin](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vinnyvin](https://discourse.processing.org/u/vinnyvin)\
**Post date:** [January 8, 2023, 10:56am UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508/3 "2023-01-08T10:56:21Z")

</div>

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.

 ![Screen Shot 2023-01-08 at 6.55.04 pm](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/7/9/79737998041715a53e917cd737592c48a1735ad4.png)

Please see screenshot above.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 8, 2023, 12:13pm UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508/4 "2023-01-08T12:13:51Z")

</div>

Move your code to tab 1 and delete tab 2?

---

<div class="post-metadata">

**Author:** ![vinnyvin](https://avatars.discourse-cdn.com/v4/letter/v/5fc32e/32.png) [@vinnyvin](https://discourse.processing.org/u/vinnyvin)\
**Post date:** [January 8, 2023, 12:23pm UTC](https://discourse.processing.org/t/syntax-error-with-void-setup-and-draw-functions/40508/5 "2023-01-08T12:23:31Z")

</div>

That has fixed it! Thanks~
