Note | This command is only available in the Xbase++ dialect |
Declare fields/ instance variables with optional initial values
[Visibility :]
[CLASS|STATIC] VAR <idVar,...> [IS <Name>] [IN <SuperClass>] [AS <idType>]
[SHARED]
[READONLY]
[ASSIGNMENT HIDDEN | PROTECTED | EXPORTED]
[NOSAVE]
Visibility | This sets the visibility for the variables on the line following the statement. This can be HIDDEN ,PROTECTED, EXPORTED or INTERNAL. The default visibility is HIDDEN. |
CLASS | STATIC | Declares that this is a class level field. |
<idVar> | A valid identifier name for the field to declare. |
IS .. IN .. | This clause is not supported in X# |
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. |
SHARED | This clause is not supported in X# |
READONLY | Declares this field as Readonly. It must be initialized in the (class) constructor |
ASSIGNMENT .. | This clause is not supported in X# |
NOSAVE | This sets the [NonSerializable] attribute on the field. |
Xbase++ has a complicated set of rules on how to control read/write access to fields. In .Net we simply use the Visibility .