delphi – 是否可以将保留字用于字段名称?
发布时间:2020-12-15 03:51:37 所属栏目:大数据 来源:网络整理
导读:出于兼容性原因(对象被序列化并导出并且必须与外部名称匹配)我希望字段名称为’type’,即 TTBaseWebResponse = classprivate type: String; success: Integer; end;orTTBaseWebResponse = classprivate ftype: String; fsuccess: Integer; public type: stri
出于兼容性原因(对象被序列化并导出并且必须与外部名称匹配)我希望字段名称为’type’,即
TTBaseWebResponse = class private type: String; success: Integer; end; or TTBaseWebResponse = class private ftype: String; fsuccess: Integer; public type: string read fstring write fstring; success: integer read fsuccess write fsuccess; end; Delphi(XE2)甚至不会编译它. 解决方法
尝试使用&在字段名称之前
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |