Well, as instance, you could use the object to return the state of the object once the message has been processed.
Imagine this scenario:
this is just a pseudo-code silly example of a possible usage for the sendmessage method
Imagine this scenario:
Const NoChange:int = 0 Const DeleteShip:int = 1 Type GameEngine Field Ships:Tlist .... .... Method UpdateShips() For S:Ship = eachin Ships Local Result:UpdateResult = UpdateResult(S.SendMessage("Update")) If Result.Status = DeleteShip then Ships.Remove(S) End If Next End Method End Type Type UpdateResult Field Status:Int=NoChange End Type Type Ship ... ... Method SendMessage:Object(Message:Object, Param:Object = Null) .... .... If Message = "Update" Then Local R:UpdateResult = New UpdateResult If ShipCollidedWithLaser then R.Status = DeleteShip Return R Else R.Status = NoChange Return R End If End If End Method End Type
this is just a pseudo-code silly example of a possible usage for the sendmessage method