SetFuncName(Value: String);
SetFuncName(Value: string);
Value. Function name.
The SetFuncName method sets function name in instance of the error which appears on writing the function without parameters and brackets in the table cell.
If any function with arguments is written in the table cell without brackets and arguments (), corresponding messages about error are displayed:
To call the <function name> function, at least one parameter is needed.
Not all mandatory parameters of <function name> are defined.
The method allows to change function name.
Executing the example requires regular report with external module, the SET_FUNC_NAME is the module identifier. One of report cells contains text set as hyperlink. Clicking the hyperlink set the Run Procedure or Function action. Determine Test as procedure or function.
Add the Tab system assembly.
Sub RaiseExceptionRequiredParams(Value: String);
Var
Ex: ITabRequiredParametersException;
Begin
Ex := New TabRequiredParametersException.CreateEx;
Ex.SetFuncName(Value);
Raise Ex;
End Sub RaiseExceptionRequiredParams;
Public Function Test: Variant;
Begin
RaiseExceptionRequiredParams("NewFunction");
Return "";
End Function Test;
This example is a macro for a regular report. On macro executing, regular report will display message with error containing the text: To call the NewFunction function it is required to have at least one parameter. That is, new function name is given on throwing an exception.
The requirements and result of Fore.NET Example match with those in the Fore Example.
Imports Prognoz.Platform.Interop.Tab;
…
Sub RaiseExceptionRequiredParams(Value: String);
Var
Ex: ITabRequiredParametersException = New TabRequiredParametersException();
Begin
Ex.CreateEx();
Ex.SetFuncName(Value);
Raise Ex As System.Exception;
End Sub RaiseExceptionRequiredParams;
Public Function Test(): Object;
Begin
RaiseExceptionRequiredParams("NewFunction");
Return "";
End Function Test;
See also: