![]() | ||
Introduction Instantiation Events & Event Handlers Global Methods & Properties | ||
A Message is an item of Data sent from one RB Instance to another (or, in ordinary words, from one RB Object to another) to cause an effect. In the image below, the Message being sent to Window2 is "Set your Title called "Property" to the text "Book List". In the second, it is being sent to the Object (which must be in the current window) called "Target" and the Message is "Execute the Method called 'Explode' ". (In other words, "Go on - Explode".) | ||
![]() | ||
Many things happen within an RB program by means of Messages sent to Instances of Objects. Messages connect all the Objects in an RB program together. Some Messages are sent "secretly" by RB without you knowing about them (except for their effect). For example, when (eg.), the user presses a window's "Close" button, RB triggers an Open Window Event and sends a Message to execute the code (if you have written any) in the corresponding Event Handler. A beginner does not need to know anything more about these secret Messages. Other messages are explicitly sent by code that you write. For example, while the Open Window Event mentioned starts to execute its Event Handler, the code in it might send a message to open another window, or add text to a Static Text Control in another window. There are two types of Messages:
An example of Type 1 is the top one in the above image, and a Type 2 example is the bottom one. Longdistance Messages If some code is written in (say) Window1's Source Code that is required to send a Message to Window2 to affect something in Window2, then that Message must include the word "Window2" (no quotation marks) to ensure that it will be sent to Window 2. For example:
The App Class For advice on sending Massages to the App Class, please see the Global Methods and Properties page. Flow Diagram To see how Messages connect Objects together, please see the Flow Diagram. | ||
Introduction Instantiation Events & Event Handlers Global Methods & Properties | ||