Defining a New Attribute for an Existing Class

To add one or more attributes to an existing class, use the following syntax:
winclass ExistingClass : ExistingClass...
attribute_definitions
Each attribute definition begins with the attribute statement, followed by the following three comma-delimited values:
  1. The text that you want to display in the Attribute panel of the Verify Window dialog box. This text must be a string.
  2. The method Silk Test Classic should use to verify the value of the attribute at runtime.
  3. The method Silk Test Classic should use to get the actual value of the attribute at runtime.

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 (steps 2 and 3 above) if none of the built-in methods suffice.

Silk Test Classic allows you to add, delete, or edit the existing functionality of a class; this applies to both functions and variables of a class. However, we recommend that you do not override a function or a variable by declaring a function or variable of that same name. Furthermore, you should never override a variable that has a tag associated with it. You cannot have two variables with the same name in the same level of an object. If you do so, Silk Test Classic will display a compile error.