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.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
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;

After executing the example the console displays data by all calculation histories saved for the PROBLEM_1 modeling problem. The data includes: calculation date, identifiers and names of all objects used in calculation, as well as the start and end date of the sample and forecasting periods that are set for the problem on calculation.

See also:

IMsCalculationHistory