XojoScript and conditional expressions

Hello, All.

I have been using XojoScript in small ways for some years. I usually build a string into an expression and allow XojoScript to return what it evaluates (example: ‘(1+2+3) *3’)

Now I have need to evaluate a simple conditional expression (example: ((if (1+3+0+4)>=5 then “10” else “0”)). I get a compile error.

Is there a way to do this?


Then "10" Else "0"

Should be something like

Then x="10" Else x="0"

Also, I don’t remember if XojoScript supports putting it all on one line.

If you want it to return the “10” or “0” then do:

if (1+3+0+4)>=5 then
   return “10”
   return “0”
end if

Xojo script is not an expression evaluator, whole scripting language.