if section=0 then begin
result:=4;
if (fDetailItem.bars:count>1) then inc(result);
{$IFDEF TestCounts}
end else if section=2 then begin
exit 1;
end else exit 4;
{$ELSE}
end else exit 4;
{$ENDIF}
(ENDIF expected, it doesn’t like the ‘end’ after the definition). In latest stable is OK, it’s just 10. beta