Skip to main content

TdxSpreadSheetFunctionParamInfo Type

The procedural type for syntax specification in spreadsheet function signatures.

Declaration

TdxSpreadSheetFunctionParamInfo = procedure(var AParamCount: Integer; var AParamKind: TdxSpreadSheetFunctionParamKindInfo);

Parameters

Name Type
AParamCount Integer
AParamKind TdxSpreadSheetFunctionParamKindInfo

Remarks

A function signature uses its syntax specification routine to define the number of accepted parameters, their types, and position order in a function call.

Use the AParamCount parameter within a TdxSpreadSheetFunctionParamInfo procedure implementation to define the total number of parameters. The AParamKind parameter allows you to define required types for each individual parameter. Call the dxSpreadSheetInitializeParamInfo global procedure to initialize both parameters.

The following code example shows how to implement a syntax specification procedure for a function that accepts an array (value range) and a single value as mandatory parameters, and a single-value optional parameter:

procedure MyFunctionSyntax(var AParamCount: Integer; var AParamKind: TdxSpreadSheetFunctionParamKindInfo);
begin
  dxSpreadSheetInitializeParamInfo(3, AParamCount, AParamKind);  // Defines the total number of accepted parameters and uses it to set the AParamKind array's size
  AParamKind[0] := fpkArray;  // The first mandatory parameter is an array
  AParamKind[1] := fpkValue;  // The second mandatory parameter is a single value
  AParamKind[2] := fpkNonRequiredValue;  // The third optional parameter is a single value
end;

A function signature’s ParamInfo field references the TdxSpreadSheetFunctionParamInfo procedural type.

Note

If the target function signature accepts no parameters, set the AParamCount parameter to 0 within a syntax specification routine.

See Also