Xbasic

Object Addresses

Description

Each object has an address that you use to manipulate the object. An object address is much like a real address. Just as "36 Bigelow St., Cambridge, MA02139" uniquely identifies someone's home, an object address uniquely identifies an object. System objects are top-level objects. They can be addressed directly by just specifying the object name. You can optionally prefix the object name with a colon to avoid any potential ambiguity if a user created object has the same name as a system object.

For example, to use the View method for the system Form object, you would use this command:

Form.View("Customer")

You can also prefix the Form object name with a colon. For example:

:Form.View("Customer")
The colon tells Alpha Anywhere to start at the highest level in the object hierarchy when searching for the object. It eliminates any ambiguity that might be caused if, for example, a user had created an object that was also called "Form".

To address user created objects, such as buttons, or text objects on forms, you need to specify the object name and also the names of any objects within which the object is contained. For example, you might have a form called Customer that has a button called Button1. The address of Button1 is:

:Customer:Button1
To make this example work from the Interactive window, you must first select Interactive > Select Interactive Window Session ... > Customer.

To understand object addressing in Alpha Anywhere it helps to think of forms and browses as Containers of other objects. Forms are the most flexible container - they can contain other forms, browses, fields, buttons, etc. Browses are less flexible, but they are still containers - they contain just columns. Assume you have a form called Customer that contains two fields, First_name and Last_name, and a browse object called Browse1 with three columns Column1, Column2, and Column3. For this form, the object hierarchy looks like:

Customer
    First_Name
    Last_Name
    Browse1
        Column1
        Column 2
        Column 3

Given the above hierarchy, the address of Column2 is:

:Customer:Browse1:Column2

The formal syntax for addressing objects can be stated as:

:container:

In our example is Column2 and there are two containers Customer and Browse1.

See Also