Build with ifdef problem


(jeremy) #1

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


(jeremy) #2

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"


(marc hoffman) #3

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


(jeremy) #4

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


(Carlo Kok) #5

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


(RemObjects) #6

Thanks, logged as bugs://79354


(RemObjects) #7

bugs://79354 got closed with status fixed.