Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Reading From and Writing to JSON Arrays.
Tue, Sep 1 2015 10:02 PMPermanent Link

Steve Gill

Avatar

I understand how to read and write single JSON records using TReader and TWriter, but are there any examples on how to read from and write to JSON arrays, ie. a structure with multiple records?

= Steve
Wed, Sep 2 2015 3:26 AMPermanent Link

Uli Becker

Steve,

> I understand how to read and write single JSON records using TReader and TWriter, but are there any examples on how to read from and write to JSON arrays, ie. a structure with multiple records?

There was a detailed discussion in the Preview NG:

http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&page=2&msg=5787

If you have problems, I can post some sample code. My Cinedisk
application uses TReader (no experience with TWrite though) to parse all
movie information.

Uli


Wed, Sep 2 2015 10:24 PMPermanent Link

Steve Gill

Avatar

<< There was a detailed discussion in the Preview NG:

http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&page=2&msg=5787

If you have problems, I can post some sample code. My Cinedisk
application uses TReader (no experience with TWrite though) to parse all
movie information. >>

Thanks Uli.  Looks pretty complicated for reading arrays.  I might stick to my pseudo-XML method.

= Steve
Thu, Sep 3 2015 3:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< Thanks Uli.  Looks pretty complicated for reading arrays.  I might stick to my pseudo-XML method. >>

The reason for this is that an "array" can be a lot more than just a basic arrary, and EWB has no way of knowing exactly how you want to size your "array" as elements are loaded.

If you want zero extra code, then make your array be a TCollection-descendant with TCollectionItem-descendant elements, and EWB will automatically know how to load/save it.

Tim Young
Elevate Software
www.elevatesoft.com
Image