help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

IsPublishedProp

Check whether a published property exists.

Declaration

Source position: line 0

function IsPublishedProp(

  Instance: TObject;

  const PropName: String

):Boolean;

function IsPublishedProp(

  AClass: TClass;

  const PropName: String

):Boolean;

Description

IsPublishedProp returns true if a class has a published property with name PropName. The class can be specfied in one of two ways:

AClass
A class pointer to the class.
Instance
An instance of the class.

Errors

No checks are done to ensure Instance or AClass are valid pointers. Specifying an invalid property name in PropName will result in an EPropertyError exception.

See also

IsStoredProp

  

Check whether a property is stored.

PropIsType

  

Check the type of a published property.

Example

program example10;

{ This program demonstrates the IsPublishedProp function }

{$mode objfpc}

uses rttiobj,typinfo;

Var
  O : TMyTestObject;
  PI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  Writeln('Property tests    : ');
  Write('IsPublishedProp(O,BooleanField)     : ');
  Writeln(IsPublishedProp(O,'BooleanField'));
  Write('IsPublishedProp(Class,BooleanField) : ');
  Writeln(IsPublishedProp(O.ClassType,'BooleanField'));
  Write('IsPublishedProp(O,SomeField)        : ');
  Writeln(IsPublishedProp(O,'SomeField'));
  Write('IsPublishedProp(Class,SomeField)    : ');
  Writeln(IsPublishedProp(O.ClassType,'SomeField'));
  O.Free;
end.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505