Code: Select all
Functions.Add(TZAbsFunction.Create('ABS'));
Code: Select all
procedure TZFunctionsList.Add(Func: IZFunction);
var
Index: Integer;
aKey : LongInt;
aName: string;
begin
aName := Uppercase(Func.Name);
aKey := Hash({$IFDEF UNICODE}AnsiString{$ENDIF}(aName));
Index := FindByKeyAndName(aKey, aName);
if Index < 0 then
begin
FFunctions.Add(Func);
SetKey(aKey, FFunctions.Count-1);
end
else
raise TZExpressionError.Create('Function '+Func.Name+' already defined!');
end;