This compiler error will occur if the not operator is placed in front of an expression that is not Boolean.
An obvious example is:
var
bOddPage
begin
bOddPage = not n_OutputPage
end
But this error may occur in a less obvious context, such as:
var
bOddPage
begin
bOddPage = not n_OutputPage mod 2 == 0 // no !
end
In this second example the problem is the precedence of evaluation of different expressions. The compiler tries to evaluate not n_OutputPage before looking at the rest of the expression.
To ensure that the compiler sees code the way you meant it, don't hesitate to use parentheses, as in the modified example below.
var
bOddPage
begin
bOddPage = not (n_OutputPage mod 2 == 0) // OK
end
The additional parentheses do not slow down execution of your macros and help make the code unambiguous to the compiler ... and to yourself if you ever need to re-read your macro a year from now.
Topic 109025, last updated on 16-Oct-2026