IMsModel.SaveZeros

Fore Syntax

SaveZeros: Boolean;

Fore.NET Syntax

SaveZeros: boolean;

Description

The SaveZeros property determines whether zero values obtained on model calculation should be saved.

Comments

Available values:

NOTE.The IMsModel.SaveZeros and IMsProblemCalculation.SaveZeros properties are working together using the AND condition. For example, if the SaveZeros model is set to True, and the SaveZeros problem calculating this model is set to False, after problem calculation only non-zero values are saved to the database.
This capability enables the user to control zero value saving both for each model and for all models calculated by the problem.

Fore Example

Executing the example requires that repository contains a modeling container with the MS identifier containing a model with the MODEL_SAVEZEROS identifier.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    mObj: IMetabaseObject;
    Model: IMsModel;
Begin
    mb := MetabaseClass.Active;
    mObj := mb.ItemByIdNamespace("MODEL_SAVEZEROS", mb.GetObjectKeyById("MS")).Edit;
    Model := mObj As IMsModel;
    Model.SaveZeros := False;
    mObj.Save;
End Sub UserProc;

After executing the example the model on calculation saves only non-zero values to the database.

Fore.NET Example

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;
    mObj: IMetabaseObject;
    Model: IMsModel;
Begin
    mb := Params.Metabase;
    mObj := mb.ItemByIdNamespace["MODEL_SAVEZEROS", mb.GetObjectKeyById("MS")].Edit();
    Model := mObj As IMsModel;
    Model.SaveZeros := False;
    mObj.Save();
End Sub;

See also:

IMsModel