This project is read-only.
Define event

Category:
Event
Description: Define F# event
Code:
# event")>]
let defineEvent() =
let e = new Event()
//trigger event, but not subscriber. Nothing happens.
e.Trigger(5)
//subscribe to the event
Event.add (fun n->printfn "%d" n) e.Publish
//trigger the event again
e.Trigger(10);

Execution Result:
10

Last edited Sep 14, 2011 at 4:09 AM by ttliu2000, version 1

Comments

No comments yet.