出于兼容性原因(对象被序列化和导出,并且必须与外部名称匹配),我希望字段名称为“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) 甚至不会编译它。 这是可能吗?怎么办?
最佳答案
尝试在字段名称前使用 &
关于delphi - 字段名称可以使用保留字吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17920716/