RAD Studio (Common)
ContentsIndex
PreviousUpNext
E2050: Statements not allowed in interface part (Delphi)

The interface part of a unit can only contain declarations, not statements. 

Move the bodies of procedures to the implementation part.

unit Produce;

interface

procedure MyProc;
begin                (*<-- Error message here*)
end;

implementation

begin
end.

We got carried away and gave MyProc a body right in the interface section.

unit Solve;

interface

procedure MyProc;

implementation

procedure MyProc;
begin
end;

begin
end.

We need move the body to the implementation section - then it's fine.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!