Interface identifier is specified after the New keyword when a variable is initialized.
Change the code, specify an object class and an available constructor when a variable is initialized.
Interface IMyInterface
End Interface IMyInterface;
Class MyClass: Object, IMyInterface
End Class MyClass;
Sub UserProc;
Var
Obj: IMyInterface;
Begin
Obj := New IMyInterface;
End Sub UserProc;
When the specified code is compiled, the string Obj := New IMyInterface; displays the following error: The New statement is not allowed for interfaces. To resolve the error, change the code to initialize the Obj variable. Correct code: Obj := New MyClass.Create;
See also: