7
votes
Closures in DWScript / OP4JS
DelphiTools
– Closures, also known as “anonymous methods” in Delphi, are now supported by DWScript for the JavaScript CodeGen, with the same syntax as in Delphi: myObject.MyEvent := procedure (Sender : TObject); begin ... end; There are of course some extensions that go beyond what Delphi supports You are allowed to use a named local procedure as a closure / anonymous method, with optional capture of local variables, allowing for neater layout of code, for instance: begin ... procedure MyLocalProc(Sender : TObject); begin ...
Statistics
|
Visits by Source |
User Actions |




