DelphiFAQ Home Search:
General :: Programming :: Delphi :: VCL
About the Delphi VCL (Visual Component Library)

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Only the 40 most recently viewed articles are shown.
You can see the full list here.

Featured Article

RTTI - determining property information

Question:

A RTTI question - it is possible to determine if a certain property is Read-Only, Write-Only or stored?


Answer:

The following code checks whether a property can be written to, read or whether it is stored.

function IsWriteProp(Info: PPropInfo) : Boolean; 
 begin 
   Result := Assigned(Info) and (Info^.SetProc<>nil) 
 end; 
 
 
 function IsReadProp : Boolean; 
 begin 
   Result := Assigned(Info) and (Info^.GetProc<>nil) 
 end; 
 
 
 function IsStoredProp : Boolean; 
 begin 
   Result := Assigned(Info) and TYPINFO.IsStoredProp(FObj, Info) 
 end; 
You don't like the formatting? Check out SourceCoder then!
Generated 16:01:31 on Sep 23, 2018