Page 1 of 1

Syntax error

Posted: Mon Dec 11, 2017 7:58 am
by nesfehani
Hi,
I am writing the code which has nested IF THEN ELSE but unfortunately I get syntax error (attached you can find the image including the code and the error). I have checked the parenthesis and commas but could not find where the problem is.
your kind help is really appreciated.

Re: Syntax error

Posted: Mon Dec 11, 2017 8:18 am
by Administrator
You cannot have 1<time to detect errors<2. Instead, use
if then else ( 1 < time to detect errors :and: time to detect errors < 2 , ......

A couple of notes as well. Nesting if then else statements is bad practice, it makes it difficult to debug. Embedding numbers in equations (such as the 1, 2 and 3 in your equation here) is also bad practice. It would be better to create a constant and put the number in there so at least someone looking at your model knows exactly what the 1, 2 and 3 are.