I currently have a LED display with the below expression. It is pulling a substring from 2 text fields that an operator populates to see if they match. It works very well, except when the field is cleared to type the next value it errors. My question is how do I write the expression to be 0 when there is no text in the field. It works fine in the designer but in client it errors and does not work. I am new to writing expressions so this may be a no brainer for many.
Value expression
if (substring ({Root Container.Generic Data.text},1,5) = substring ({Root Container.Serial Number.text},2,6),1,0)
Text Expression
if({Root Container.Displacement Display.value}, "Launch", "Stop")
The expression language is not Python and doesn't use Python syntax. You can think of it working like Excel's formulas (but without the opening '=' operator). The expression is one continuous expression. It doesn't do multiple sequential statements. It is, however, very tolerant of line breaks and indentation so it is easy to make indented readable expressions with comments using the // comment syntax. The expression in your original post could be formatted as shown below. Which is easier to debug?