SaveO(Options: CubeInstanceStorageOptions; [ValueFlag: Integer = -1]): Variant;
Options. Data saving modes.
ValueFlag. Flag that indicates changed data.
The SaveO method saves data in the specified mode.
The action principle and the returned result of the of the SaveO method match with the Save method, but along with this there is an ability to set a data saving mode.
Executing the example requires that the repository contains a cube with the STD_CUBE identifier.
Add links to the Cubes, Matrix, and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Variable: IVariableStub;
Result: IVariableStubExecuteResult;
Mat: IMatrix;
Ite: IMatrixIterator;
Begin
MB := MetabaseClass.Active;
Variable := MB.ItemById("STD_CUBE").Bind As IVariableStub;
Result := Variable.Execute(Null, -1, True);
// Get an empty matrix with a cube structure
Mat := Result.Matrix;
Mat.ValueFlag := 1;
// Navigate through matrix in iterator and fill it with values
Ite := Mat.CreateIterator;
Ite.Move(IteratorDirection.First);
While Ite.Valid Do
Ite.Value := //...Set values by some criterion
Ite.Move(IteratorDirection.Next);
End While;
// Save changes to cube
Debug.WriteLine(Result.SaveO(CubeInstanceStorageOptions.InsertNulls, Mat.ValueFlag));
End Sub UserProc;
Executing the example provides a matrix, which structure corresponds to the cube structure. An iterator will be built based on the matrix, the iterator can be used to determine values of single points by some criterion. After this, the changed matrix will be saved back to the cube in the mode of saving empty records.
See also: