Build with ifdef problem

This used to work, now it doesn’t like it:

      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

This is probably related:

method siteMenuTableViewController.tableView(tableView: UITableView) titleForHeaderInSection(section: NSInteger): NSString;
begin
  case section of
    0: exit 'Site Menu';
  {$IFDEF TestCounts}
    2: exit 'Generate Counts';
  {$ENDIF}
    else exit 'Site Details';
  end;
end;

Error is in the line with the IFDEF:
(E374) colon (:) or comma (,) expected, got "exit"

See https://talk.remobjects.com/t/ifdef-changes-explained/14790

Thanks marc, missed that. Makes sense. In a lot of ways, it’s more readable anyway.

1 Like

That said; the “case” should work. I’ll log that one.

2 Likes

Thanks, logged as bugs://79354

bugs://79354 got closed with status fixed.