SetParamName (Value: String);
SetParamName (Value: string);
Value. Parameter name.
The SetParamName method sets function name in instance of the error that appears on writing the function with incorrect parameter type in the cell.
If any function with parameters is written to the cell table with incorrect parameter type, then corresponding error message is displayed:
Unknown identifier <parameter name>.
The method allows to change parameter name.
Executing the example requires regular report with external module, the SET_PARAM_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.
This example is an event handling module for regular report.
Add a link to the Tab system assembly.
Sub RaiseExceptionUnknownParam(Value: String);
Var
Ex: ITabUnknownParameterException;
Begin
Ex := New TabUnknownParameterException.CreateEx;
Ex.SetParamName(Value);
Raise Ex;
End Sub RaiseExceptionUnknownParam;
Public Function Test: Variant;
Begin
RaiseExceptionUnknownParam("UnknownParameter");
Return "";
End Function Test;
Imports Prognoz.Platform.Interop.Tab;
…
Sub RaiseExceptionUnknownParam(Value: String);
Var
Ex: ITabUnknownParameterException = New TabUnknownParameterException();
Begin
Ex.CreateEx();
Ex.SetParamName(Value);
Raise Ex As System.Exception;
End Sub RaiseExceptionUnknownParam;
Public Function Test(): Object;
Begin
RaiseExceptionUnknownParam("UnknownParameter");
Return "";
End Function Test;
After executing the example the regular report will display error message containing the UnknownParameter Unknown Identifier text. That is, new parameter name is given on throwing an exception.
See also: