My minimal example is a variable of Long integer variable type defined by the expression

(10 < 2)? 1:4

which I have copied straight from the helpfile, just replacing a and b with 1 and 4. I would have thought this would place the value 4 in the variable (because 10 is not less than 2, so it returns the expression to the right of the colon). But instead I get WB0027 “Expression has a syntax error”. What am I doing wrong?

no this is not a problem: The questionnaire compiles even if you set the variable as type Long, since, as you wrote indeed the result is of integer type.
The problem is likely not in the definition of the variable, but perhaps related to it’s use later in the questionnaire.

OK, I think I solved this myself, just by defining the variable as a Double instead of a Long integer. This seems a little odd to me as both expressions return integers, but perhaps was the solution.