Syntax for Attributes

To add one or more attributes to an existing class, use the following syntax:

winclass ExistingClass : ExistingClass...
attribute_definitions

Each attribute definition must begin and end on its own line.

When you define a new attribute, you usually need to define two new methods if none of the built-in methods suffices.

For example, to add a new attribute to the DialogBox class that verifies the number of children in the dialog box, you add code like this to your test frame (or other include file):

winclass DialogBox:DialogBox

  attribute "Number of children", VerifyNumChild, GetNumChild

  integer GetNumChild()
     return ListCount (GetChildren ()) // return count of children of dialog

  hidecalls VerifyNumChild (integer iExpectedNum)
     Verify (GetNumChild (), iExpectedNum, "Child number test")

As this example shows, you use the hidecalls keyword when defining the verification method for the new attribute.