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.
Syntax error
Syntax error
- Attachments
-
- ERROR.jpg (332.58 KiB) Viewed 1215 times
-
- Super Administrator
- Posts: 4573
- Joined: Wed Mar 05, 2003 3:10 am
Re: Syntax error
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.
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.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559