7
votes
Vote UpVote

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 ...
Favorite? Off-Topic? Eric @ 2012-01-21 16:31

Statistics

Visits: 625
Votes: 7
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Ericc
François
Jan Derk
Jørn E. Angeltveit
Linas
Primoz Gabrijelcic
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)