# Can you help -- mouse over thing gives error Unexpected identifier

**URL:** <https://discourse.processing.org/t/can-you-help-mouse-over-thing-gives-error-unexpected-identifier/2888>\
**Category:** Beginners\
**Created:** [August 23, 2018, 6:01pm UTC](https://discourse.processing.org/t/can-you-help-mouse-over-thing-gives-error-unexpected-identifier/2888 "2018-08-23T18:01:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![warrenj](https://avatars.discourse-cdn.com/v4/letter/w/6de8d8/32.png) [@warrenj](https://discourse.processing.org/u/warrenj)\
**Post date:** [August 23, 2018, 6:01pm UTC](https://discourse.processing.org/t/can-you-help-mouse-over-thing-gives-error-unexpected-identifier/2888/1 "2018-08-23T18:01:38Z")

</div>

Can you help find and fix the Unexpected identifier error …

int thingX = 10; int thingY = 20;  
int thingW = 30; int thingH = 40;

void setup() {  
// noStroke();  
} // end setup

void draw() {  
// mouse over ( thing )  
( mouseX \> ( thingX )  
&& mouseX \< ( thingX ) + thingW  
&& mouseY \> thingY )  
&& mouseY \< ( thingY ) + thingH ) ?  
fill( 0,255,0 ) : fill( 255,0,0 )  
rect( thingX,thingY, thingW,thingH );  
} // end draw

---

<div class="post-metadata">

**Author:** ![EnhancedLoop7](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/enhancedloop7/32/1040_2.png) [@EnhancedLoop7](https://discourse.processing.org/u/EnhancedLoop7)\
**Post date:** [August 23, 2018, 6:28pm UTC](https://discourse.processing.org/t/can-you-help-mouse-over-thing-gives-error-unexpected-identifier/2888/2 "2018-08-23T18:28:06Z")

</div>

I’m sure you will be getting a response from someone telling you to format your code, so I would first drop that little note 😃

Your code seems to be quite incomplete, where is your if statement? I assume that is what you want to do:

```auto
 if ( mouseX > thingX && mouseX < ( thingX + thingW ) && mouseY > thingY && mouseY < ( thingY + thingH) ) 
  {
    fill( 0,255,0 ); 
  }
 else
   {
  fill( 255,0,0 );  
   }

rect( thingX, thingY, thingW,thingH );

```

Yeah, I think I can see what is you were trying to do? Kind of looked like those enhanced conditional if’s from C++ 😂

Anyways, hopefully that makes sense. You were close but just missing the if statement, and you had the “:” which I’m sure gave the Unexpected Identifier error.

EnhancedLoop7
