Hi Dominic,
right!
Many brains have constructed VFP, but these did not have them same thoughts.
Uses IIF():
SELECT * FROM table WHERE (field = 'abc' and SomeFunction(field))
it becomes
SELECT * FROM table WHERE IIF(field = 'abc',SomeFunction(field),.F.)
Attention!
This optimize NULL expression.
If you need NULL logic propagation ( like IF evaluation )
(for example need evaluate field NULL into SomeFunction):
SELECT * FROM table WHERE IIF(field # 'abc',.F.,field = 'abc' AND SomeFunction(field))
Fabio