lazarus - 类属性 : Error: Illegal symbol for property access

标签 lazarus freepascal delphi

我有这个变量、函数、属性组合

ffieldIntegerPrivate:Integer;
function getFieldIntegerPrivate:Integer;
class property fieldIntegerPrivate:Integer read getFieldIntegerPrivate;

在实现中我有

function TMyClass.getFieldIntegerPrivate:Integer;
begin
    Result := ffieldIntegerPrivate;
end;

我收到错误:错误:属性访问的非法符号

导致此错误的原因是什么?

预先感谢您的帮助。

最佳答案

类属性只能读取class var

关于lazarus - 类属性 : Error: Illegal symbol for property access,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35181551/

相关文章:

linux - Lazarus 链接在 Linux Mint 18.3 Cinnamon 上失败

delphi - 如何将文本附加到 Web 服务器上的文件?

forms - Delphi应用程序窗口z顺序和MainFormOnTaskBar属性

delphi - 如何更改 TreeView 节点高度,在节点中绘制 3 条线

delphi - Delphi 中重载过程出错

delphi - 如何声明一个函数,该函数采用尚未识别的类型的变量作为参数

lazarus - 如何使用 TFileStream 在覆盖现有文件之前截断现有文件?

delphi - 德尔福中的多行插入符?

xml - 如何在 OmniXML 和 Delphi 自己的 XML 库之间转换代码?

freepascal - Pascal 中的三位实数