Show/Hide Toolbars

XSharp

NoteThis command is only available in the FOXPRO dialect

Purpose

Adds objects from other classes to the class definition.

Syntax

 ADD OBJECT [Modifiers] <ObjectName> AS <idType> [NOINIT] [WITH <Propertylist>]]

Arguments

ModifiersAn 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.

 

NOINITThis 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.

Notes

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.