procedure RMSetStrProp(aObject: TObject; const aPropName: string; ID: Integer); var lStr: string; lPropInfo: PPropInfo; begin lStr := RMLoadStr(ID); if lStr <> ‘‘ then begin lPropInfo := GetPropInfo(aObject.ClassInfo, aPropName); if lPropInfo <> nil then SetStrProp(aObject, lPropInfo, lStr); end; end; function RMGetPropValue(aReport: TRMReport; const aObjectName, aPropName: string): Variant; var pi: PPropInfo; lObject: TObject; begin Result := varEmpty; if aReport <> nil then lObject := RMFindComponent(aReport.Owner, aObjectName) else lObject := RMFindComponent(nil, aObjectName); if lObject <> nil then begin pi := GetPropInfo(lObject.ClassInfo, aPropName); if pi <> nil then begin case pi.PropType^.Kind of tkString, tkLString, tkWString: Result := GetStrProp(lObject, pi); tkInteger, tkEnumeration: Result := GetOrdProp(lObject, pi); tkFloat: Result := GetFloatProp(lObject, pi); end; end; end; end;
时间: 2024-10-07 05:06:41