0 Members and 1 Guest are viewing this topic.
For all I know the servers built in ooo is just the same as standard pascal. But honestly, do you really need to use it? Most of theese problems can be used with parantesis, and if not, the problem is usually easy to isolate
In complex expressions, rules of precedence determine the order in which operations are performed.Precedence of operators OperatorsPrecedence@, notfirst (highest)*, /, div, mod, and, shl, shr, assecond+, -, or, xorthird=, <>, <, >, <=, >=, in, isfourth (lowest)An operator with higher precedence is evaluated before an operator with lower precedence, while operators of equal precedence associate to the left. Hence the expressionX + Y * Zmultiplies Y times Z, then adds X to the result; * is performed first, because is has a higher precedence than +. ButX - Y + Zfirst subtracts Y from X, then adds Z to the result; - and + have the same precedence, so the operation on the left is performed first.You can use parentheses to override these precedence rules. An expression within parentheses is evaluated first, then treated as a single operand. For example,(X + Y) * Zmultiplies Z times the sum of X and Y.Parentheses are sometimes needed in situations where, at first glance, they seem not to be. For example, consider the expressionX = Y or X = ZThe intended interpretation of this is obviously(X = Y) or (X = Z)Without parentheses, however, the compiler follows operator precedence rules and reads it as(X = (Y or X)) = Zwhich results in a compilation error unless Z is Boolean.Parentheses often make code easier to write and to read, even when they are, strictly speaking, superfluous. Thus the first example could be written asX + (Y * Z)Here the parentheses are unnecessary (to the compiler), but they spare both programmer and reader from having to think about operator precedence.
if ( ((a = b) or (c = d)) and (d <> a)) then begin //...end;