Member-of Operator

Ways to Use Member-of

Use the member-of operator (.) to perform the following operations:

  • Separating parts of fully qualified object names.
  • Separating method names from object names in method calls.
  • Getting and setting properties of objects.
  • Referring to fields in records.

Fully Qualifying Object Names

To call methods or properties to manipulate an object, you specify the object’s fully qualified name. The complete name is composed of the name of the object itself and the names of each of its ancestors. Separate each ancestor name with the member-of operator:

parent-window-name.child-window-name
For example, you might refer to the Find item on the Text Editor’s Search menu as follows:
TextEditor.Search.Find

Calling Methods

To call a method by name, you precede its name with the fully qualified name of the object you want the method to act upon. Separate the object name from the method name with the member-of operator:

full-wname.method (arguments)
Argument Description
full-wname The name of the window itself and the names of each of its ancestors, separated with the member-of operator.
method A Silk Test Classic method or user-defined method.
argument The appropriate arguments to the method, if any.
For example, you might pick the Find item on the Text Editor’s Search menu as follows:
TextEditor.Search.Find.Pick ()

Getting and Setting Properties

To get and set an object's properties, precede its name with the complete name of a window. Separate the property name and the window name with the member-of (.) operator:

To get the value of a property, use this format:

variable = complete-window-name.property

To set the value of a property, use this format:

complete-window-name.property = value

For example, you might get the current selection in the Filename list box of the File Open dialog box as follows:

STRING x = FileOpen.Filename.sValue

And to set the selection string in the Filename list box in the File Open dialog box:

FileOpen.Filename.sValue = "test.txt"

Referring to Fields in Records

You refer to a field in a record with an expression of the form record.field. For example, if the record MyEmployee contains a field sPhone, you might refer to the field as follows:
MyEmployee.sPhone = "123-4567"