Object of the <ClassName> Class has no default Property

Description

An indexed property of the class is referred to but no default property is available in the class.

Troubleshooting Tips

One of the indexed properties of the class should be declared using the Default directive or identifier of the property that is referred to should be explicitly specified. Using various directives is described in the Descriptions and Rules of Syntax: Classes Description section.

Example

Class TestClass: Object
    Temp: Array Of Integer;
    
    Public Property Item(i: Integer): Integer
        Get
        Begin
            Return Temp[i];
        End Get
        Set
        Begin
            Temp[i] := Value;
        End Set
    End Property Item;
End Class TestClass;

Sub Main;
Var
    Obj: TestClass;
    i: Integer;
Begin
    Obj := New TestClass.Create;
    i := Obj(1);
End Sub Main;

When the specified code is compiled, the string i := Obj(1); displays the following error: Object of the <ClassIdentifier> class has no default property. To resolve the error, execute one of the following operations:

See also:

Compiler Messages