When the old syntax of describing a parameterized property is used, a class field is given after the access specifier.
Class fields can be used only in description of parameterless properties. If the property is parameterized, methods need to be used as handlers.
A method that has the same number of parameters as the described property must be indicated after the Get access specifier.
A method that has one more parameters than the described property must be indicated after the Set access specifier. First parameters will match property indexes. The last parameter will contain the assigned value.
Class TestClass: Object
PropValue: String;
Public Property Item(i: Integer): String Get PropValue Set PropValue;
End Class TestClass;
After the the specified code is compiled, the following error is displayed: Indexed property cannot be associated with fields. To resolve the error, execute one of the operations:
Remove the "i" parameter from the property description.
Define the function and procedure identifiers respectively after the access specifiers Get and Set.
See also: