加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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)甚至不会编译它.
这是可能吗?怎么样?

解决方法

尝试使用&在字段名称之前

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读