Show/Hide Toolbars

XSharp

NoteThis command is only available in the FOXPRO dialect

Purpose

Declare fields and or properties with optional initial values

Syntax

 [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)

Arguments

 

FIELD When you include the FIELD keyword then the names will be the names of fields in the class

 

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

 

ExpressionThe initial value to assign to the field/property

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.