Language documentation | Contents | Index |
Delegates are functions contained by an object (by object you should understand an instantiated class) that are referenced by a variable. Delegates cannot be static functions. A delegate should respect the rights of the calling point (so, if is private, the caller must be able to call the delegate). Delegates can be passed as parameters to functions providing callback. |
class Main { function mydelegate(x) { echo x; // prints x } function Main() { var f=mydelegate; // now e can call the delegate function this way: f(); } } |
Documented by Eduard Suica, generation time: Sun Jan 27 18:15:22 2013 GMT | (c)2013 Devronium Applications |