# Idk why but I get this error message: Expected an assignment or function call and instead saw an expression

**URL:** https://discourse.processing.org/t/idk-why-but-i-get-this-error-message-expected-an-assignment-or-function-call-and-instead-saw-an-expression/24311
**Category:** Beginners
**Created:** [October 3, 2020, 4:49pm UTC](https://discourse.processing.org/t/idk-why-but-i-get-this-error-message-expected-an-assignment-or-function-call-and-instead-saw-an-expression/24311 "2020-10-03T16:49:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![olaf000olaf](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olaf000olaf/32/11295_2.png) [@olaf000olaf](https://discourse.processing.org/u/olaf000olaf)
#### Post date: [October 3, 2020, 4:49pm UTC](https://discourse.processing.org/t/idk-why-but-i-get-this-error-message-expected-an-assignment-or-function-call-and-instead-saw-an-expression/24311/1 "2020-10-03T16:49:27Z")

</div>

```
if (timer = 98){
	xd1 == xd1 * -1;
	yd1 == yd1 * -1;
}
```

---

<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: [October 3, 2020, 5:01pm UTC](https://discourse.processing.org/t/idk-why-but-i-get-this-error-message-expected-an-assignment-or-function-call-and-instead-saw-an-expression/24311/2 "2020-10-03T17:01:24Z")

</div>

you mixed up == and =

This is better:

```auto

if (timer == 98) {
  xd1 = xd1 * -1;
  yd1 = yd1 * -1;
}

```

- The == is for comparison
- the = is for assigning a value

---

<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: [October 3, 2020, 5:01pm UTC](https://discourse.processing.org/t/idk-why-but-i-get-this-error-message-expected-an-assignment-or-function-call-and-instead-saw-an-expression/24311/3 "2020-10-03T17:01:51Z")

</div>

Hey, and welcome to the forum, great to have you here!

😉
