Closed GoogleCodeExporter closed 9 years ago
ompiler.addGlobalFuncFromClass('class procedure TForm1.MyWrite1(S: string);',
@TForm1.MyWrite1, TForm1);
Compiler.addGlobalFuncFromObject('function procedure TForm1.MyWrite2(S:
string);', @TForm1.MyWrite2);
Original comment by pult....@gmail.com
on 19 Sep 2011 at 7:12
Thanks for reporting. Might be useful indeed.
Original comment by niels....@gmail.com
on 21 Sep 2011 at 1:03
I added addGlobalMethod to the repository, which lets you do this:
Compiler.addGlobalMethod('procedure _write(s: string); override;', @MyWrite,
Form1);
MyWrite still needs to be a wrapping function, as it sends "self" as parameter
too:
procedure MyWrite(Params: PParamArray);
begin
with TForm1(Params^[0]) do
m.Text := m.Text + PlpString(Params^[1])^;
end;
I do not plan on adding the option to invoke methods for imported functions.
Original comment by niels....@gmail.com
on 10 Nov 2011 at 11:28
Original issue reported on code.google.com by
pult....@gmail.com
on 19 Sep 2011 at 7:11