#51 mORMot 1 » TDocVariantData.Value vs TDocVariantData.Values » 2015-05-17 20:22:37

dexter
Replies: 4

Hi,

here is the code sample.

var
  V, V2                                 : TDocVariantData;
begin
  V.InitJSON('{"DATA":[{"NAME":"Name1","COMMENT":"Comment1"},{"NAME":"Name2","COMMENT":"Comment2"}],"DATA_ROWS":2}');
  V2 := TDocVariantData(V.Values[0]);
  Assert(V2.Kind = dvArray); // <-- here is OK
  V2 := TDocVariantData(V.Value[0]);
  Assert(V2.Kind = dvArray); // <- here is exception
end;

When I'm accessing Values property - it returns data as array.
When I'm accessing Value property by index or name - data kind is dvUndefined.

Is this proper behavior?

#52 mORMot 1 » _Json and single quote JSON » 2015-05-09 18:17:45

dexter
Replies: 1

Hi,

if I try TDocVariant.NewJSON() with the following input: {'id':'10'} - it raises error.

If instead of single quotes I'm using double quotes, i.e. {"id":"10"}, it's fine.

Isn't allowed in JSON to put values and names in singe quotes?

#53 Re: mORMot 1 » Synopse mORMot Framework SAD 1.18.pdf is corrupted » 2015-04-24 15:34:07

same for me. I was hoping to upload it to my iPad...

Board footer

Powered by FluxBB