ahausladen / JsonDataObjects

JSON parser for Delphi 2009 and newer
MIT License
413 stars 160 forks source link

functions to get values to variants and to add variant values #8

Closed kattunga closed 9 years ago

kattunga commented 9 years ago

Hi, actually you can't do the following:

var
  v: variant;
begin
  v := jsonobject['my name']; 
end;

It would be nice to have a new property like:

v := jsonobject.V['my name'];

To return value to a variant with the datatype stored in json datavalue. Of course this should raise an exception if you are trying to cast an object or an array.

It would be useful to to have an overload of TObjectArray.Add procedure to add a variant value to an array using the vartype of the value to determine json datatype.

Actually I do this with 2 procedures, I don't want to change your source code because later is a madness to maintain updates.

With best regards Christian

ahausladen commented 9 years ago

You can fork, make changes, commit and push them to your fork and then create a pull request. That way you have your changes and if I find them useful I can pull them and integrate them into my branch.

kattunga commented 9 years ago

I'll do that. Thank you.