[Pas2js] anonymous record type

warleyalex warleyalex at yahoo.com.br
Sat Aug 1 13:12:36 CEST 2020


I've converted some partial mORMot client cross platform units to pas2js in
the past, but unfortunately I could not finish them because of the missing
"anonymous record" feature. I remember the Delphi server is compiled in both
FPC and windows as well. The CRUD part is missing, because of that pas2js
missing feature. 

See at
https://blog.synopse.info/?post/2014/08/11/CrossPlatform-Clients/SmartMobileStudio

This feature is important, because delphi server, will generates
automatically pas2js client units when the server have some CRUD, and
complex record structures is expected to work. We should use the record type
to store/retrieve the JSON data. For instance, the following JSON would be
mapped to anonnymous record type structure.

{
        "RowID" : 1,
        "FirstName" : "First1",
        "LastName" : "Last1",
        "Data" : null,
        "YearOfBirth" : 1801,
        "YearOfDeath" : 1826,
        "Another" : 1,
        "Sexe" : 0,
        "Simple" : {
                "F" : "",
                "G" : [],
                "H" : {
                        "H1" : 0,
                        "H2" : "",
                        "H3" : {
                                "H3a" : false,
                                "H3b" : null
                        }
                },
                "I" : "",
                "J" : []
        }
}





--
Sent from: http://pas2js.38893.n8.nabble.com/


More information about the Pas2js mailing list