// 声明自己的函数库
type
TMyFunctionLibrary = class(TfrFunctionLibrary)
public
constructor Create;
override;
proceduredo
Function(FNo: Integer;
p1, p2, p3: Variant;
var val: Variant);
override;
end;
constructor TMyFunctionLibrary.Create;
begin
inherited Create;
with Listdo
begin
Add('DATEPROPIS');
Add('SUMPROPIS');
end;
end;
procedure TMyFunctionLibrary.DoFunction(FNo: Integer;
p1, p2, p3: Variant;
var val: Variant);
begin
val := 0;
case FNo of
0: val := My_DateConvertion_Routine(frParser.Calc(p1));
1: val := My_SumConvertion_Routine(frParser.Calc(p1));
end;
end;
// 注册自己的函数库
frRegisterFunctionLibrary(TMyFunctionLibrary);
// 增加函数说明
frAddFunctionDesc('SUMPROPIS', 'My functions',
'SUMPROPIS(<Number>)/Returns value spelled out.');