[Pas2js] anonymous record type

warleyalex warleyalex at yahoo.com.br
Thu Dec 5 19:39:56 CET 2019


There are cross units to smart mobile.
http://blog.synopse.info/post/2014/08/11/CrossPlatform-Clients/SmartMobileStudio

Now, I'm translating some cross-Platform mORMot Clients to pas2js. 
The first draft is shown at https://www.youtube.com/watch?v=mitrHJIJUQ0

We should use the record type to store/retrieve the JSON data. 
One thing I could find a way is to populate this complex JSON object, like
this: 

{
	"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" : []
	}
}

this json would be mapped to this record type structure:

type // define some enumeration types, used below
  TPeopleSexe = (sFemale, sMale);
  TRecordEnum = (reOne, reTwo, reLast);

type // define some record types, used as properties below
  TSimpleJSONArray = record
    F: String;
    G: array of String;
    H: record
      H1: Integer;
      H2: String;
      H3: record
        H3a: Boolean;
        H3b: TSQLRawBlob;
      end;
    end;
    I: TDateTime;
    J: array of record
      J1: Byte;
      J2: TGUID;
      J3: TRecordEnum;
    end;
  end;      

hum,I'm stuck, anonymous record type not yet implemented in pas2js. In order
to perform
to use CRUD/ORM remote access we need anonymous record in some way.

One other minor thing is "enum const" - status: not yet implemented
for instance:

  TSQLFieldBit = enum (Low = 0, High = 255);
  TSQLFieldBits = set of TSQLFieldBit;






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


More information about the Pas2js mailing list