Declares a class field variable.
Field Identifier:Type [ = Expression ]
Field Identifier:= Expression
The Field keyword declares an instance variable within a custom class. The field is valid for the lifetime of the object it belongs to.
A field's default value upon object creation can be set in the field's declaration.
To access an object's fields, use the syntax object.field. (See example.)
The alternative syntax provided allows the variable's type to be deduced from the expression.
Const | Local | Global
Language reference
' Declaring class and fieldsClass Player Field name:String Field points:Int = 0End' Creating object "p" of type "Player"Local p:Player = New Player' Accessing fieldsp.name = "Mary"p.points = 100Print p.namePrint p.points