I have written an object under Turbo Delphi that has a property that I would like to assign to a procedure type, but the compiler refuses to compile. It is unclear to me what I am doing wrong, maybe you all can help.
The type is declared like so...
Type
TProc = Procedure(Const S: String) of Object;
The class declaration looks like this
TMyClass = ....
Private
FVar : TProc;
...
Property AVar : TProc Write FVar;
Then there is this procedure declaration...
Procedure AProc(Const S :String);
begin
MessageBox(S,mtError,[mbOk],0);
end;
The following assignment snags the compiler ...
MyClass.AVar := AProc('String...');
saying I am trying to assign the wrong type. Any ideas.
-- Rich