DEFINE CLASS Command - Property Definition Clause

Defines properties and their values for the class definition.

[[PROTECTED | HIDDEN] PropertyName1, PropertyName2 ...]
[[.]Object.]PropertyName = eExpression ...]

Parameters

[PROTECTED | HIDDEN] PropertyName1, PropertyName2 ...]

Specifies one or more class properties to create. Properties are named attributes of the class and define characteristics and behaviors for the class. Use commas to separate each property or declare each property on a separate line.

NoteNote

All property definitions must appear before function or procedure definitions.

The PROTECTED keyword prevents access and changes to the specified properties from outside of the class definition. Methods and events in the class or subclass definition can access protected properties.

The HIDDEN keyword prevents access and changes to the specified properties from outside of the class definition. However, only methods and events in the class definition, not subclasses, can access hidden properties.

NoteTip

You can create subclasses with Access and Assign methods if you do not include the HIDDEN keyword.

[[.]Object.] PropertyName= eExpression ...]

Assigns default values to class properties. Using .Object. indicates that Visual FoxPro should apply the value to an ActiveX control property when creating it. For more information, see the Examples section.

Expand imageRemarks

Expand imageExample

Expand imageSee Also


© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic