9
Procedure DumpMem ( PL : PByte );
16
Write ((I-1)*16:3,' :');
19
If (PL^>31) and (PL^<129) then
31
Function ProcType (PP : Byte) : String;
35
ptfield : Result:='from Field';
36
ptstatic : Result:='with static method';
37
ptVirtual : Result:='with virtual method';
38
ptconst : Result:='with Const';
42
Procedure DumpTypeInfo (O : TMyTestObject);
52
Writeln ('Type kind : ',TypeNames[PI^.Kind]);
53
Writeln ('Type name : ',PI^.Name);
56
If PT^.ParentInfo=Nil then
57
Writeln ('Object has no parent info')
59
Writeln ('Object has parent info');
60
Writeln ('Property Count : ',PT^.PropCount);
61
Writeln ('Unit name : ',PT^.UnitName);
62
GetMem (PP,PT^.PropCount*SizeOf(Pointer));
64
For I:=0 to PT^.PropCount-1 do
68
Writeln ('Property name : ',Name);
69
Writeln (' Type kind: ',TypeNames[PropType^.Kind]);
70
Writeln (' Type Name: ',PropType^.Name);
71
If GetProc=Nil then Write ('No');
72
Writeln (' Getproc available');
73
If SetProc=Nil then Write ('No');
74
Writeln (' Setproc available');
75
If StoredProc=Nil then Write ('No');
76
Writeln (' Storedproc available');
77
Writeln (' Get property ',proctype(Propprocs));
78
Writeln (' Set Property ',proctype(propprocs shr 2));
79
Writeln (' Stored Property ',proctype(propprocs shr 4));
80
Writeln (' Default : ',Default,' Index : ',Index);
81
Writeln (' NameIndex : ',NameIndex);
85
Procedure PrintObject ( Obj: TMyTestObject);
90
Writeln ('Field properties :');
91
Writeln ('Property booleanField : ',booleanField);
92
Writeln ('Property ByteField : ',ByteField);
93
Writeln ('Property CharField : ',CharField);
94
Writeln ('Property WordField : ',WordField);
95
Writeln ('Property IntegerField : ',IntegerField);
96
Writeln ('Property LongintField : ',LongintField);
97
Writeln ('Property CardinalField : ',CardinalField);
98
Writeln ('Property RealField : ',RealField);
99
Writeln ('Property ExtendedField : ',ExtendedFIeld);
100
Writeln ('Property AnsiStringField : ',AnsiStringField);
101
Writeln ('Property MyEnumField : ',ord(MyEnumField));
102
Writeln ('Method properties :');
103
Writeln ('Property booleanMethod : ',BooleanMethod);
104
Writeln ('Property ByteMethod : ',ByteMethod);
105
Writeln ('Property CharMethod : ',CharMethod);
106
Writeln ('Property WordMethod : ',WordMethod);
107
Writeln ('Property IntegerMethod : ',IntegerMethod);
108
Writeln ('Property LongintMethod : ',LongintMethod);
109
Writeln ('Property CardinalMethod : ',CardinalMethod);
110
Writeln ('Property RealMethod : ',RealMethod);
111
Writeln ('Property ExtendedMethod : ',ExtendedMethod);
112
Writeln ('Property AnsiStringMethod : ',AnsiStringMethod);
113
Writeln ('Property MyEnumMethod : ',ord(MyEnumMethod));
114
Writeln ('VirtualMethod properties :');
115
Writeln ('Property booleanVirtualMethod : ',BooleanVirtualMethod);
116
Writeln ('Property ByteVirtualMethod : ',ByteVirtualMethod);
117
Writeln ('Property CharVirtualMethod : ',CharVirtualMethod);
118
Writeln ('Property WordVirtualMethod : ',WordVirtualMethod);
119
Writeln ('Property IntegerVirtualMethod : ',IntegerVirtualMethod);
120
Writeln ('Property LongintVirtualMethod : ',LongintVirtualMethod);
121
Writeln ('Property CardinalVirtualMethod : ',CardinalVirtualMethod);
122
Writeln ('Property RealVirtualMethod : ',RealVirtualMethod);
123
Writeln ('Property ExtendedVirtualMethod : ',ExtendedVirtualMethod);
124
Writeln ('Property AnsiStringVirtualMethod : ',AnsiStringVirtualMethod);
125
Writeln ('Property MyEnumVirtualMethod : ',ord(MyEnumVirtualMethod));
129
Procedure TestGet (O : TMyTestObject);
140
Writeln ('Type kind : ',TypeNames[PI^.Kind]);
141
Writeln ('Type name : ',PI^.Name);
143
If PT^.ParentInfo=Nil then
144
Writeln ('Object has no parent info')
146
Writeln ('Object has parent info');
147
Writeln ('Property Count : ',PT^.PropCount);
148
Writeln ('Unit name : ',PT^.UnitName);
149
GetMem (PP,PT^.PropCount*SizeOf(Pointer));
151
For I:=0 to PT^.PropCount-1 do
156
Write ('(Examining ',name,' : Type : ',TypeNames[PropType^.Kind],', ');
157
If (Proptype^.kind in Ordinaltypes) Then
159
J:=GetOrdProp(O,pri);
160
Write ('Value : ',j);
161
If PropType^.Kind=tkenumeration then
162
Write ('(=',GetEnumName(Proptype,J),')')
165
Case pri^.proptype^.kind of
169
Write(GetFloatProp(O,pri))
174
Write(GetStrProp(O,Pri));
177
Write ('Untested type:',ord(pri^.proptype^.kind));
184
Var O : TMyTestObject;
187
O:=TMyTestObject.Create;