Delphi, like all languages and tools, has its uses. Some folks use it for good. Others use it for evil. Still others somehow manage to break the language itself.

Oliver T. has been using Delphi 7 for the last decade. In particular, he has a DLL that has worked quite well during that time to produce a variety of MS Word document for his clients to send to their clients. With the advent of new requirements, he imported the Word Type Library for Office 2007, and compilation failed. Puzzled, he clicked "Find Declaration" on break, and saw this:

              end;
            end;
          break;
        end;
        Readln(F, S);
      end;
      CloseFile(F);
    end;
  end;
end;

While that looked harmless enough, he was astonished to discover that this is where it led:

// *********************************************************************//
// Interface: Break
// Flags:     (4544) Dual NonExtensible OleAutomation Dispatchable
// GUID:      {79635BF1-BD1D-4B3F-A520-C1106F1AAAD8}
// *********************************************************************//
  Break = interface(IDispatch)
    ['{79635BF1-BD1D-4B3F-A520-C1106F1AAAD8}']
    function Get_Application: WordApplication; safecall;
    function Get_Creator: Integer; safecall;
    function Get_Parent: IDispatch; safecall;
    function Get_Range: Range; safecall;
    function Get_PageIndex: Integer; safecall;
    property Application: WordApplication read Get_Application;
    property Creator: Integer read Get_Creator;
    property Parent: IDispatch read Get_Parent;
    property Range: Range read Get_Range;
    property PageIndex: Integer read Get_PageIndex;
  end;
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!