TdxSpreadSheetFunctionsRepository.Add(TcxResourceStringID,TdxSpreadSheetFunction,TdxSpreadSheetFunctionParamInfo,TdxSpreadSheetFunctionResultKind,Word,TdxSpreadSheetFunctionType,TcxResourceStringID,Integer,Boolean) Method
Adds a new function signature to the spreadsheet function repository.
Declaration
procedure Add(const AName: TcxResourceStringID; AProc: TdxSpreadSheetFunction; AParamInfo: TdxSpreadSheetFunctionParamInfo; AResultKind: TdxSpreadSheetFunctionResultKind; AToken: Word; AType: TdxSpreadSheetFunctionType = ftCommon; const ADescription: TcxResourceStringID = nil; APrefixID: Integer = 0; AAvailableInContainerControls: Boolean = True);
Parameters
Name | Type |
---|---|
AName | TcxResourceStringID |
AProc | TdxSpreadSheetFunction |
AParamInfo | TdxSpreadSheetFunctionParamInfo |
AResultKind | TdxSpreadSheetFunctionResultKind |
AToken | Word |
AType | TdxSpreadSheetFunctionType |
ADescription | TcxResourceStringID |
APrefixID | Integer |
AAvailableInContainerControls | Boolean |
Remarks
Call this procedure to create a new or replace an existing function signature in the repository, depending on the AName parameter value. Each accepted parameter value initializes the corresponding field of the function signature.
Parameter | Description | A Function Signature’s Field |
---|---|---|
AName | Accepts a pointer to the resource string that contains a required function public name. Every function signature in the repository must have a public name. The Add procedure calls the GetInfoByName function to identify if the repository already contains a function with the specified name. The Add procedure replaces the matching function signature’s field values with the corresponding parameters; otherwise – creates a new function signature. | |
AProc | Accepts a reference (in Delphi) or pointer (in C++Builder) to a routine that implements the target function. Every valid function signature has an implementation routine. A function signature without an implementation is reserved. | |
AParamInfo | Accepts a reference (in Delphi) or pointer (in C++Builder) to a routine that defines the target function’s syntax in formula expressions. | |
AResultKind | Accepts a result type (that is, a single value, array, etc.) that the function signature’s implementation is designed to return. | |
AToken | Accepts an XLS format token of the function signature. XLS token values range between 0 and 2047 for implemented and reserved built-in functions to ensure compatibility with XLS documents. Pass 2048 or a higher value if you need to create a custom function signature. | |
AType | Accepts a category (that is, a group of functions that share a common purpose) to which the function signature belongs. A category is optional for a function signature. The signature does not belong to a specific category found in popular spreadsheet applications if the AType parameter is unspecified. | |
ADescription | Accepts a pointer to the resource string that contains a required function description. Pass nil (in Delphi) or nullptr/NULL (in C++Builder), or leave the parameter unspecified if the function signature requires no description. | |
APrefixID | Accepts a value (0 or 1) that defines which XLSX name token prefix the function signature requires. Pass 1 if the function signature implements a function introduced in Microsoft Excel® 2010 or newer; otherwise – pass 0 or leave the parameter unspecified. | |
AAvailableInContainerControls | Accepts a value that defines whether the “Expression Editor“ dialog lists the function signature. Pass False if the function signature’s implementation does not support calculated fields (that is, accepts or returns value ranges). Otherwise – pass True or leave the parameter unspecified. |
Note
Call the Remove procedure to remove a specific function signature from the repository.