# Syntax Error on Token

**URL:** <https://forum.inductiveautomation.com/t/syntax-error-on-token/58930>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 27, 2022, 3:12pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930 "2022-04-27T15:12:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 27, 2022, 3:12pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/1 "2022-04-27T15:12:06Z")

</div>

I have been trying to get an icon to become invisible or visible based on whether a property value is between a range within an expression  
this is my code

```auto
if (({session.custom.winddirect} = ( <= 337.5 && >= 22.5 )), ({this.meta.visible} = 1), ({this.meta.visible} = 0))

```

the error\_configuration im getting is Error\_Configuration(“Runtime Exception: syntax error on token: ‘LESS THAN OR EQUAL TO’ (Line 1, Char 38)”)

Additionally, if i replace the less than and greater than value with 0 it gives me a different error saying Error\_CycleDetected I am having a hard time figuring out why this does not work.  
Would greatly appreciate any advice

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 27, 2022, 3:16pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/2 "2022-04-27T15:16:19Z")

</div>

The `<=` operator needs two values. So you need to supply the value you are wanting to be between 337.5 and 22.5

```auto
if (({session.custom.winddirect} = ( {someValueHere} <= 337.5 && {someValueHere} >= 22.5 )), ({this.meta.visible} = 1), ({this.meta.visible} = 0))
```

---

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 27, 2022, 3:19pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/3 "2022-04-27T15:19:42Z")

</div>

Thank you lrose i think that resolved it but can you tell me what is meant by cycle detected or how i can work around it

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 27, 2022, 3:23pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/4 "2022-04-27T15:23:50Z")

</div>

I would assume that it would probably mean it is referencing itself. Not sure, where is this binding being used?

---

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 27, 2022, 3:25pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/5 "2022-04-27T15:25:49Z")

</div>

Im binding the visible property of an icon and im trying to have the result of the if statement turn the visibility = 1 if within the range or else = 0 if it isnt within the range.  
Yes i am trying to refer it to itself but i cant think of another way to do it

---

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 27, 2022, 3:28pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/6 "2022-04-27T15:28:25Z")

</div>

Thank you lrose i figured it out i just took out the self.meta stuff and replaced it with 1 and 0 and it works, i realise what cycle error is now

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 27, 2022, 3:29pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/7 "2022-04-27T15:29:01Z")

</div>

Wouldn’t this expression:

```auto
{someValue} <= 337.5 && {someValue} >= 22.5

```

Accomplish what you want?

---

<div class="post-metadata">

**Author:** ![Dean\_Walsh](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@Dean\_Walsh](https://forum.inductiveautomation.com/u/Dean_Walsh)\
**Post date:** [April 27, 2022, 3:32pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/8 "2022-04-27T15:32:48Z")

</div>

Yes, it has been accomplished i am not fluent in how to structure my scripts, yet but with your help i am one step further. Thank you again for your time.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 27, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token/58930/9 "2022-04-27T17:52:56Z")

</div>

> [@Dean\_Walsh](#):
>
> how to structure my scripts

Be careful with terminology. Expression bindings are _ **not** _ scripts. They don't support statements or assignments. Just operators and functions.
