if not((bit1=1) and bool_var) then ... // always evaluates trueSee Website of Janni, "mP PRO for PIC quirks and errors".
const ValA:byte; external; const ArrayA: array[ValA] of byte; external;cannot be done. Instead use
const ValA:byte; external; const ArrayA: array[10] of byte; external; // dummy sizeThe correct size will be returned by e.g. SizeOf(ArrayA), no matter the dummy size.