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

SetMethodProp

Set the value of a method property

Declaration

Source position: line 0

procedure SetMethodProp(

  Instance: TObject;

  PropInfo: PPropInfo;

  const Value: TMethod

);

procedure SetMethodProp(

  Instance: TObject;

  const PropName: String;

  const Value: TMethod

);

Description

SetMethodPropassigns Valueto the method the property described by PropInfoor with name Propnamefor object Instance.

The type TMethodof the Valueparameter is defined in the SysUtilsunit as:

TMethod = packed record
  Code, Data: Pointer;
end;                                                                         

Datashould point to the instance of the class with the method Code.

For an example, see GetMethodProp.

Errors

No checking is done whether Instanceis non-nil, or whether PropInfodescribes a valid method property of Instance. Specifying an invalid property name in PropNamewill result in an EPropertyErrorexception.

See also

GetMethodProp

  

Return value of a method property

SetOrdProp

  

Set value of an ordinal property

SetStrProp

  

Set value of a string property

SetFloatProp

  

Set value of a float property.

SetInt64Prop

  

Set value of a Int64 property