Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use reserved words for field names?

Tags:

delphi

For compatibility reasons (objects are serialized and exported and must match external names) I would like to have a field name being 'type', i.e.

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) won't even compile this. Is this at all possible? How?

like image 730
Jan Doggen Avatar asked Jul 29 '13 09:07

Jan Doggen


1 Answers

Try using & before the field name

like image 167
Kenny Cason Avatar answered Oct 14 '22 04:10

Kenny Cason