rodgarcialima / superobject

Automatically exported from code.google.com/p/superobject
0 stars 0 forks source link

Insufficient RTTI available Error on some records #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am using Delphi XE 
I have a record

     tmyrec=packed record
       myname:string ; 
       mysurname:string  ;
       myage:integer;
       mydate:tdatetime;
     end;

Using superobject I can convert it to a json string but when I try it with 

     tmyrec=packed record
       myname:string[50] ; 
       mysurname:string[50]  ; //I put limited strings here
       myage:integer;
       mydate:tdatetime;
     end;

I get error 
Insufficient RTTI available to support this operation.

How can I serialize such records? can you send an example? thank you.

Original issue reported on code.google.com by ustun...@gmail.com on 8 Jun 2011 at 2:14

GoogleCodeExporter commented 9 years ago
This is delphi RTTI's problem.
you can change your code to:

tmyrec_myname = string[50];
tmyrec_mysurname = string[50];
tmyrec=packed record
  myname:tmyrec_myname; 
  mysurname:tmyrec_mysurname; //I put limited strings here
  myage:integer;
  mydate:tdatetime;
end;

Original comment by Huckebei...@gmail.com on 13 Jun 2012 at 4:01