-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuJSONSerializationWithSynopseForm.pas
More file actions
70 lines (58 loc) · 1.63 KB
/
Copy pathuJSONSerializationWithSynopseForm.pas
File metadata and controls
70 lines (58 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
unit uJSONSerializationWithSynopseForm;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, SynCommons, Soap.InvokeRegistry;
{$M+}
type
TJSONSerializationWithSynopseForm = class(TForm)
SerializeButton: TButton;
LogMemo: TMemo;
procedure SerializeButtonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
{$M-}
var
JSONSerializationWithSynopseForm: TJSONSerializationWithSynopseForm;
implementation
uses
uJSONSerializationTestObjects;
{$R *.dfm}
procedure TJSONSerializationWithSynopseForm.SerializeButtonClick(Sender: TObject);
var
LTestObj : TMyRemotableTestObj;
LTestObj2 : TMyPlainTestObj;
LTestObj3 : TMyPersistentTestObj;
begin
LTestObj := TMyRemotableTestObj.Create;
try
LTestObj.Name := 'Joe Bloggs';
LTestObj.BirthDate := EncodeDate (1985, 08, 01);
LTestObj.Children := 12;
LogMemo.Lines.Add(ObjectToJSON(LTestObj));
finally
LTestObj.Free;
end;
LTestObj2 := TMyPlainTestObj.Create;
try
LTestObj.Name := 'Joe Bloggs';
LTestObj.BirthDate := EncodeDate (1985, 08, 01);
LTestObj.Children := 12;
LogMemo.Lines.Add(ObjectToJSON(LTestObj2));
finally
LTestObj2.Free;
end;
LTestObj3 := TMyPersistentTestObj.Create;
try
LTestObj.Name := 'Joe Bloggs';
LTestObj.BirthDate := EncodeDate (1985, 08, 01);
LTestObj.Children := 12;
LogMemo.Lines.Add(ObjectToJSON(LTestObj3));
finally
LTestObj3.Free;
end;
end;
end.