CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA (Disney web site)
CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA In this example, the Caption property associated with an instance of a PushButton control named the PushButton1 is assigned a value of Cancel. Note, this example assumes the code for this statement was placed within the method belonging to the window where the PushButton1 control was added or within one of the methods belonging to a control on that window. If, on the other hand, the PushButton1 control resides on another window, you must specify the full path to the control using the following syntax to refer to it. WindowName.ObjectName.PropertyName = Value Note Up to this point in the book, you have been keying in code statements associated with either a window or one of its controls. The collection of code statements associated with either of these types of resources is referred to as a method within REALbasic programming. You learn more about methods later in Chapter 8. For example, if the PushButton1 control you wanted to modify resided on a window named Window2, you would need to modify this example as the following shows. Window2.Pushbutton1.Caption = “Cancel” ME AND SELF REALbasic provides a pair of useful programming shortcuts you may want to use to streamline your program statements. Me is a keyword that refers to the control in which program code is placed. By referring to Me in place of a control s name, you can reduce the amount of keystrokes required to complete your code statements. For example, you could rewrite PushButton1.Caption = “Cancel” as Me.Caption = “Cancel” This example assumes the code for this statement is located within the method associated with the PushButton1 control. Another advantage of using the Me keyword in place of a specific control s name is this: because the Me keyword is generic, you can reuse it by copying-and-pasting it into the method of another PushButton control without then having to modify the ObjectName part of the statement. Self is a keyword that refers to a control s parent object. For example, the parent object of a PushButton control would be the window on which it was placed. Thus, instead of programmatically referring to a window s Title property from within one of its controls as Window1.Title = “My test Application” You could, instead, generically reference the property using the Self pronoun as the following shows. Self.Title = “My test Application”
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.