A property is an attribute of an object. After you have added a type library to an ATEasy application, you can use the properties of the objects that it exposes. The syntax for getting a property value is:
Object.Property
The line of code below shows an example of getting a property value:
print ob.Caption
Some properties are read-only, in which case you can only retrieve or get their values. Other properties are writable, which means that you can set their values. The syntax for setting the value of a writable property is:
Object.Property=value
The values that you can set for a property depend on its type. For example, properties that are of type string take string values, while properties that are of type Bool can be set to TRUE or FALSE.
For example, the Microsoft Excel Worksheet class lists properties that could be attributes of specific worksheet objects. In the code sample shown below, two statements contain property settings:
xlapp.Visible=TRUE
xlapp.Caption="ATEasy Excel Demo Using Early Binding"
In the first line, the Visible property of the Excel Application object is set to TRUE, meaning that the Excel main window will be visible to the user. If this property were set to FALSE, no Excel components would be visible to the user. In the second line, the Caption property of the Excel Application object is defined as a string. This string will appear in the application's window bar as shown below:
Properties can also have parameters. For example, in the line of code below, an Excel Chart object uses the Axes property, which in turn uses the Caption parameter:
cht.Axes(1).Caption = "Hello"