IMsCalculationHistory.Date

Syntax

Date: DateTime;

Description

The Date property returns date of creating calculation history.

Example

Executing the example requires that the repository contains a modeling container with the KONT_MODEL identifier containing a problem with the PROBLEM_1 identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

Hists, HistChild: IMetabaseObjectDescriptors;

HistObj, HistObj1: IMetabaseObjectDescriptor;

Hist: IMsCalculationHistory;

Prob: IMsProblem;

Period: IMsForecastingProblem;

i, j: Integer;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemByIdNamespace("PROBLEM_1", MB.ItemById("KONT_MODEL").Key).Bind;

Hists := MObj.Children;

Debug.WriteLine(Hists.Count);

For i := 0 To Hists.Count - 1 Do

Hist := Hists.Item(i).Bind As IMsCalculationHistory;

HistObj := Hists.Item(i);

HistChild := HistObj.Children;

Debug.WriteLine(Hist.Date);

Debug.Indent;

For j := 0 To HistChild.Count - 1 Do

HistObj1 := HistChild.Item(j);

Debug.WriteLine(HistObj1.Id + " | " + HistObj1.Name);

If HistObj1.ClassId = MetabaseObjectClass.KE_CLASS_MSPROBLEM Then

Prob := HistObj1.Bind As IMsProblem;

Period := Prob.Details As IMsForecastingProblem;

Debug.Indent;

Debug.WriteLine(Period.Period.IdentificationStartDate);

Debug.WriteLine(Period.Period.IdentificationEndDate);

Debug.WriteLine(Period.Period.ForecastStartDate);

Debug.WriteLine(Period.Period.ForecastEndDate);

Debug.Unindent;

End If;

End For;

Debug.Unindent;

End For;

End Sub Main;

After executing the example the data by all calculation histories, saved for the PROBLEM_1 modeling problem is displayed in the console. The data includes: date of calculation, identifiers and names of all objects used in calculation, as well as the start and end date of the sample and forecasting period set for the problem at calculation.

See also:

IMsCalculationHistory