| Note | This command is only available in the FOXPRO dialect |
Adds objects from other classes to the class definition.
ADD OBJECT [Modifiers] <ObjectName> AS <idType> [NOINIT] [WITH <Propertylist>]]
| Modifiers | An optional list of modifiers that specify the visibility or scope of the entity, such as PUBLIC, PROTECTED, HIDDEN, INTERNAL. |
| <ObjectName> | A valid identifier name for the fields or properties to declare. |
| AS <idType> | Specifies the data type. If omitted, then depending on the compiler options the type will be either USUAL or determined by the compiler. |
| NOINIT | This clause is not supported. |
| WITH <PropertyList> | Specifies a list of properties and their values for the object that you add to the class definition. |
The object will be instantiated and added to the list of "child objects" in the class. Also, a property will be created with the name and type specified in the ADD OBJECT clause.
The way in which properties are implemented depends on the value of the /fox1 compiler switch. When this switch is enabled, then all properties will read/write from a property collection that is declared in the Custom Object. When this switch is NOT enabled, then 'normal' auto properties will be declared with a backing field in this class.