ParamValues: IAlgorithmParameterValues;
The ParamValues property returns algorithm calculation start and end period settings and the collection of calculation algorithm parameters.
Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. The calculation algorithm should contain calculation objects.
Add links to the Algo and Metabase system assemblies. Add a link to the assembly required for working with calculation algorithm.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObjectDescriptor;
Algo: ICalcObject;
CalcAlgo: ICalcAlgorithm;
Params: IAlgorithmParameterValues;
SDate, EDate: DateTime;
Begin
MB := MetabaseClass.Active;
// Get calculation algorithm
MObj := MB.ItemById("ALGORITHM");
Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
CalcAlgo := Algo As ICalcAlgorithm;
// Get settings of start and end of algorithm calculation period
Params := CalcAlgo.ParamValues;
// Determine start and end dates of algorithm calculation
SDate := DateTime.Parse("15.10.2020");
EDate := DateTime.Parse("30.10.2020");
// Check if dates are in the allowed dates range
If (SDate > Params.MinAllowDate) And (EDate < Params.EndDate) Then
// Set start and end dates of algorithm calculation
Params.StartDate := SDate;
Params.EndDate := EDate;
End If;
// Calculate algorithm
CalcAlgo.Calculate;
End Sub UserProc;
After executing the example, calculation algorithm objects are calculated for the period from 15.10.2020 to 30.10.2020.
See also: