![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » Elevate Web Builder Technical Support » Incident Reports » Incident Reports Addressed for Version 2.04 » View Incident Report |
![]() |
Reported By: Doug B Reported On: 12/2/2015 For: Version 2.03 Build 1 |
unit TestCase; interface uses WebCore; type TNested = class(TPersistent) fValue: Integer; fDescription: string; published property Value: Integer read fValue write fValue; property Description: string read fDescription write fDescription; end; TComposite = class(TPersistent) fField: string; fNested: TNested; public constructor Create; override; destructor Destroy; override; function ToJson: string; published property Field: string read fField write fField; property Nested: TNested read fNested write fNested; end; function TestJson: string; implementation constructor TComposite.Create; begin inherited Create; fNested := TNested.Create; end; destructor TComposite.Destroy; begin fNested.Free; inherited Destroy; end; function TComposite.ToJson: string; var Writer: TWriter; begin Writer := TWriter.Create; try Writer.Initialize; Save(Writer); Result := Writer.Output; finally Writer.Free; end; end; function TestJson: string; var c: TComposite; begin c := TComposite.Create; try c.Field := 'field'; c.Nested.Value := 10; c.Nested.Description := 'description'; Result := c.ToJson; finally c.Free; end; end; end.
This web page was last updated on Monday, November 13, 2023 at 07:46 AM | Privacy Policy![]() © 2023 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |