[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'typinfo' (#rtl)

IsStoredProp

Check whether a property is stored.

Declaration

Source position: line 0

function IsStoredProp(

  Instance: TObject;

  PropInfo: PPropInfo

):Boolean;

function IsStoredProp(

  Instance: TObject;

  const PropName: String

):Boolean;

Description

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.

Errors

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.

See also

IsPublishedProp

  

Check whether a published property exists.

PropIsType

  

Check the type of a published property.

Example

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.