Control Structures

to set

Supported By

Syntax

to set propertyName to variableName
   statementList
end set

Description

The to set handler defines the behavior of a user-defined object when property propertyName is set. When a script sets the propertyName of a user-defined object, the statements in the corresponding to set handler are executed. The new value of the property is passed through the local variable variableName.

Notes

Unlike parameters to an on or a function handler, which are converted to strings unless declared otherwise, the parameter to a to set handler is kept as-is, as if declared as a variant.

This structure is only valid inside an object type structure.

See Also

object type