# Syntax Error on Token: 'BOUND CONST'

**URL:** <https://forum.inductiveautomation.com/t/syntax-error-on-token-bound-const/46989>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [May 21, 2021, 2:31pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token-bound-const/46989 "2021-05-21T14:31:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joelle.rennick](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@joelle.rennick](https://forum.inductiveautomation.com/u/joelle.rennick)\
**Post date:** [May 21, 2021, 2:31pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token-bound-const/46989/1 "2021-05-21T14:31:14Z")

</div>

Hello! I am trying to animate a component so that it will change colour based off the status of a tag. I don’t think I am doing it the best way… Right now, I have a Data Type of this tag with different type structures bound to each status tag. I am trying to bind this to a custom component called DetermineColour so that whichever status is true will return a number that I can associate with a colour. I am using the code below and keep getting the error “Syntax Error on Token: ‘BOUND CONST’ (Line 1, Char 43)”. Please let me know what this means and if there is a better way to go about doing this. Thanks!

If {[default]Z1/C07\_1\_201Status/OTE2.value} = true Then DetermineColour = 0  
Else If {[default]Z1/C07\_1\_201Status/RDY.value} = true Then DetermineColour = 2  
Else If ({[default]Z1/C07\_1\_201Status/RNG\_F.value} Or {[default]Z1/C07\_1\_201Status/RNG\_R.value}) = true Then DetermineColour = 1  
Else If {[default]Z1/C07\_1\_201Status/RST.value} = true Then DetermineColour = 4  
Else DetermineColour = 3

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 21, 2021, 2:35pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token-bound-const/46989/2 "2021-05-21T14:35:19Z")

</div>

You’re not using syntax that is valid for the expression language (the if/else procedural statements as if it were a scripting language).

You probably want the [if](https://docs.inductiveautomation.com/display/DOC81/if) or [switch](https://docs.inductiveautomation.com/display/DOC81/switch) functions.

---

<div class="post-metadata">

**Author:** ![cmszr3](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@cmszr3](https://forum.inductiveautomation.com/u/cmszr3)\
**Post date:** [September 7, 2021, 3:43pm UTC](https://forum.inductiveautomation.com/t/syntax-error-on-token-bound-const/46989/3 "2021-09-07T15:43:12Z")

</div>

Hi Joelle -

I am also am trying the same thing. Did you ever find a resolution?

Caitlyn
