C#, Vici Parser Conditional Statements

272 views Asked by At

Can any one help me out to evaluate this expression at runtime using Vici parser.

I have tried other usual expressions like 5* VARIABLE kinda expression. But is it possible to evaluate conditional statements using VICI parser.

Example: IF SAL > 5 THEN 25 ELSE 45 ENDIF

Thanks...

1

There are 1 answers

1
Philippe Leybaert On

You should use the ?: syntax:

SAL > 5 ? 25 : 45

You can expand this for multiple conditions as well:

SAL > 5 ? 25 : SAL > 10 ? 35 : 45