Time([StartDate: String = "";][CustomFrequency: MsFrequency = 0]): Variant;
Time(StartDate: string;
CustomFrequency: Prognoz.Platform.Interop.Ms.MsFrequancy;
Context: Prognoz.Platform.Interop.Fore.IForeRuntimeContext): object;
StartDate. Reference date used to create values. Observation at this point has zero value. This parameter is optional. Default value corresponds with the start date of the model sample period.
CustomFrequency. The frequency, values for which are created. Optional parameter. By default the frequency is undetermined and matches the model frequency
Context. Context. Applied only in Fore.NET.
The Time method returns a time series, which value increases by 1 for each successive observation.
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. Parameter value StartDate 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 |
Executing the example requires a modeling container with the CONT_MODEL identifier, that contains a deterministic equation model with the DUMMIS_DETERM identifier. Add links to the Metabase, 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 temporary variableis used in the model equation.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Ms;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
MsDescr: IMetabaseObjectDescriptor;
Model: IMsModel;
Transf: IMsFormulaTransform;
Determ: IMsDeterministicTransform;
Begin
mb := Params.Metabase;
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;
See also: