[Overview][Constants][Types][Classes][Procedures and functions] |
Check whether a property is stored.
Source position: line 0
function IsStoredProp( |
Instance: TObject; |
PropInfo: PPropInfo |
):Boolean; |
Instance: TObject; |
const PropName: String |
):Boolean; |
IsStoredPropreturns Trueif the Storedmodifier evaluates to Truefor the property described by PropInfoor with name PropNamefor object Instance. It returns Falseotherwise. If the function returns True, this indicates that the property should be written when streaming the object Instance.
If there was no storedmodifier in the declaration of the property, Truewill be returned.
No checking is done whether Instanceis non-nil, or whether PropInfodescribes a valid property of Instance. Specifying an invalid property name in PropNamewill result in an EPropertyErrorexception.
|
Check whether a published property exists. |
|
|
Check the type of a published property. |
program example11; { This program demonstrates the IsStoredProp function } {$mode objfpc} uses rttiobj,typinfo; Var O : TMyTestObject; PI : PPropInfo; begin O:=TMyTestObject.Create; Writeln('Stored tests : '); Write('IsStoredProp(O,StoredIntegerConstFalse) : '); Writeln(IsStoredProp(O,'StoredIntegerConstFalse')); Write('IsStoredProp(O,StoredIntegerConstTrue) : '); Writeln(IsStoredProp(O,'StoredIntegerConstTrue')); Write('IsStoredProp(O,StoredIntegerMethod) : '); Writeln(IsStoredProp(O,'StoredIntegerMethod')); Write('IsStoredProp(O,StoredIntegerVirtualMethod) : '); Writeln(IsStoredProp(O,'StoredIntegerVirtualMethod')); O.Free; end.