SaveZeros: Boolean;
The SaveZeros property determines the upload calculated zeros to the base parameter on modeling problem calculation.
Available values:
True. Default value. Zero values obtained on problem calculation are loaded to database.
False. After problem calculation only non-zero values are saved in database.
NOTE. The IMsProblemCalculation.SaveZeros and IMsModel.SaveZeros properties operate together by 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.
Executing the example requires that the repository has a modeling container with the MS identifier containing a modeling problem with the PROBLEM_SAVEZEROS identifier.
Add links to the Metabase, Ms system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Problem: IMsProblem;
CalcSett: IMsProblemCalculationSettings;
Calculation: IMsProblemCalculation;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemByIdNamespace("PROBLEM_SAVEZEROS", MB.ItemById("MS").Key).Bind;
Problem := MObj As IMsProblem;
CalcSett := Problem.CreateCalculationSettings;
Calculation := Problem.Calculate(CalcSett);
Calculation.SaveZeros := False;
Calculation.SaveData := True;
Calculation.Run;
End Sub UserProc;
After executing the example the problem is calculated, only non-zero values are saved to database.
See also: