# Unused variables

**URL:** <https://discourse.processing.org/t/unused-variables/1855>\
**Category:** Processing\
**Created:** [July 17, 2018, 3:45pm UTC](https://discourse.processing.org/t/unused-variables/1855 "2018-07-17T15:45:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffmarc](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jeffmarc](https://discourse.processing.org/u/jeffmarc)\
**Post date:** [July 17, 2018, 3:45pm UTC](https://discourse.processing.org/t/unused-variables/1855/1 "2018-07-17T15:45:11Z")

</div>

the pde does not tell me or give me a list of unused variables declared but not used anywhere  
can i get this somehow when i run the sketch.  
it tells me if there is a variable it can’t find but i wanna know if i have ones i am not using and forgot to delete

thanks

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [July 17, 2018, 4:06pm UTC](https://discourse.processing.org/t/unused-variables/1855/2 "2018-07-17T16:06:19Z")

</div>

It sounds like you’re asking about two different things:

Unused variables, like this:

```auto
void draw(){
  float x = 42;
  println("hello");
}

```

And undeclared variables, like this:

```auto
void draw(){
  println(x);
}

```

Can you please post a small code example that demonstrates exactly what you’re talking about? Also what exactly are you trying to do?

---

<div class="post-metadata">

**Author:** ![MxFxM](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@MxFxM](https://discourse.processing.org/u/MxFxM)\
**Post date:** [July 18, 2018, 5:46am UTC](https://discourse.processing.org/t/unused-variables/1855/3 "2018-07-18T05:46:53Z")

</div>

Which version of Processing are you running? I use 3.3.6 and it shows yellow marks on the right side at every point where a variable is declared but not used. I’m not 100% sure if it works everywhere but I know for sure that variables like these:

```auto
void aFunction(int thisone) {
  println("i dont need any variables");
}

```

will be marked.
