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
|
program test_widestrprop_p2;
{$mode objfpc}{$H+}
uses
Classes, SysUtils, TypInfo;
type
TClass_A = class(TPersistent)
private
Fwsp: UnicodeString;
published
property wsp : UnicodeString read Fwsp write Fwsp;
end;
var
x : TClass_A;
begin
x := TClass_A.Create();
WriteLn('Reading :');
x.wsp := 'azerty';
WriteLn(' Using GetUnicodeStrProp() : ',GetUnicodeStrProp(x,'wsp'));
if GetUnicodeStrProp(x,'wsp')<>'azerty' then
halt(1);
WriteLn(' Using GetStrProp() : ',GetStrProp(x,'wsp'));
if GetStrProp(x,'wsp')<>'azerty' then
halt(1);
WriteLn(' Using GetWideStrProp() : ',GetWideStrProp(x,'wsp'));
if GetWideStrProp(x,'wsp')<>'azerty' then
halt(1);
WriteLn('Writing :');
x.wsp := '';
SetUnicodeStrProp(x,'wsp','azerty');
WriteLn(' Using SetUnicodeStrPr() : ',x.wsp);
if x.wsp<>'azerty' then
halt(1);
x.wsp := '';
SetStrProp(x,'wsp','azerty');
WriteLn(' Using SetStrPr() : ',x.wsp);
if x.wsp<>'azerty' then
halt(1);
x.wsp := '';
SetWideStrProp(x,'wsp','azerty');
WriteLn(' Using SetWideStrPr() : ',x.wsp);
if x.wsp<>'azerty' then
halt(1);
writeln('ok');
end.
|