Note | This command is only available in the FOXPRO dialect |
Declare fields and or properties with optional initial values
[FIELD] [modifiers] <IdName>, <IdName> ...] [AS <idType>]
[[.]Object.] <IdName> = <Expression> ...]
Both syntaxes to declare and/or initialize properties are supported.
We have added an optional AS DataType clause.
We have also added an optional FIELD clause that allows you to declare fields (opposed to properties)
FIELD | When you include the FIELD keyword then the names will be the names of fields in the class |
Modifiers | An optional list of modifiers that specify the visibility or scope of the property, such as PUBLIC,. PROTECTED, HIDDEN. |
<IdName> | 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. |
Expression | The initial value to assign to the field/property |
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.