LB Booster
Programming >> Compatibility with LB4 >> Operator precedence: AND and OR
http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1385458444
Operator precedence: AND and OR
Post by Richard Russell on Nov 26th, 2013, 08:34am
Liberty BASIC handles expressions which contain both AND and OR operators in a non-standard way. This article at the LB Bug Tracker Wiki explains the issue:
http://libertybasicbugs.wikispaces.com/Logical+operator+precedence
To date, LBB has not attempted to emulate this behaviour but instead evaluates AND before OR, as in most other programming languages. I had hoped that it would be rare for this incompatibility to be important, but I have recently encountered a large program which fails for this reason.
I therefore propose to modify LBB so that it evaluates AND and OR with equal priority (left-to-right) as LB does. I realise that this may be controversial, but I find it difficult to justify emulating the non-standard behaviour of INT but not the non-standard behaviour of AND/OR.
Richard.