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



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

GetPropList

Return a list of a certain type of published properties.

Declaration

Source position: line 0

function GetPropList(

  TypeInfo: PTypeInfo;

  TypeKinds: TTypeKinds;

  PropList: PPropList;

  Sorted: Boolean = true

):LongInt;

function GetPropList(

  TypeInfo: PTypeInfo;

  out PropList: PPropList

):SizeInt;

function GetPropList(

  AObject: TObject;

  out PropList: PPropList

):Integer;

Description

GetPropList stores pointers to property information of the class with class info TypeInfo for properties of kind TypeKinds in the list pointed to by Proplist. PropList must contain enough space to hold all properties.

The function returns the number of pointers that matched the criteria and were stored in PropList.

Errors

No checks are done to see whether PropList points to a memory area that is big enough to hold all pointers.

See also

GetPropInfos

  

Return a list of published properties.

GetPropInfo

  

Return property type information, by property name.

Example

Program example13;

{ This program demonstrates the GetPropList function }

uses
  rttiobj,typinfo;


Var
  O : TMyTestObject;
  PT : PTypeData;
  PI : PTypeInfo;
  I,J : Longint;
  PP : PPropList;
  prI : PPropInfo;

begin
  O:=TMyTestObject.Create;
  PI:=O.ClassInfo;
  PT:=GetTypeData(PI);
  Writeln('Total property Count : ',PT^.PropCount);
  GetMem (PP,PT^.PropCount*SizeOf(Pointer));
  J:=GetPropList(PI,OrdinalTypes,PP);
  Writeln('Ordinal property Count : ',J);
  For I:=0 to J-1 do
    begin
    With PP^[i]^ do
      begin
      Write('Property ',i+1:3,': ',name:30);
      writeln('  Type: ',TypeNames[typinfo.PropType(O,Name)]);
      end;
    end;
  FreeMem(PP);
  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