IMsCustomTerm.Time

Syntax

Time([StartDate: String = "";]

     [CustomFrequency: MsFrequency = 0]): Variant;

Parameters

StartDate. A reference date that is used to create values.

CustomFrequency. The frequency, for which values are created.

Description

The Time method returns the time series, which value increases by 1 for each successive observation.

Comments

The Time temporary variable can contain positive and negative values. Assume that start date of the model sample period is 01.01.2003, end date is 01.01.2009. The value of the StartDate parameter is 01.01.2006. The variable will contain the following values:

Year

2003

2004

2005

2006

2007

2008

2009

Time value

-3

-2

-1

0

1

2

3

Features of setting parameters:

Example

Executing the example requires that the repository contains a modeling container with the CONT_MODEL identifier that contains a determinate equation model with the DUMMIS_DETERM identifier.

Add links to the Metabase and Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    MsDescr: IMetabaseObjectDescriptor;
    Model: IMsModel;
    Transf: IMsFormulaTransform;
    Determ: IMsDeterministicTransform;
Begin
    mb := MetabaseClass.Active;
    MsDescr := mb.ItemById("CONT_MODEL");
    Model := mb.ItemByIdNamespace("DUMMIES_DETERM", MsDescr.Key).Edit As IMsModel;
    Transf := Model.Transform;
    Determ := Transf.FormulaItem(0).Method As IMsDeterministicTransform;
    Determ.Expression.AsString := "Time(""" + "01.01.2006" + """)";
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a temporary variable is used in the model equation.

See also:

IMsCustomTerm