ParamValues: IMetabaseObjectParamValues;
The ParamValues property enables the user to set current parameters of global variables without saving the global variables area.
Use the ApplyParamValues method after parameters setting.
NOTE. To read the current value of global variable, use the IMetabaseCache.SharedValue property.
Sub SetGlobalVariableValue;
Var
MB: IMetabase;
SParams: ISharedParams;
GlobalVar: IMetabaseObjectParamValue;
Begin
MB := MetabaseClass.Active;
SParams := Mb.SpecialObject(MetabaseSpecialObject.SharedParams).Bind As ISharedParams;
GlobalVar := SParams.ParamValues.FindById("GLOBAL_INT");
GlobalVar.Value := 25;
SParams.ApplyParamValues;
End Sub SetGlobalVariableValue;
After executing the example the value of the global variable is set.
See also: