Fore > Fore Assembly Interfaces > ISharedParams > ISharedParams.Params
Params: IMetabaseObjectParams;
The Params property returns the collection of global variables.
Executing the example requires that the global variables area in the repository contains a global variable with the GLOBAL_INT identifier.
Add links to the Dal, Fore, and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
SParams: ISharedParams;
GlobalVar: IMetabaseObjectParam;
Begin
MB := MetabaseClass.Active;
SParams := Mb.SpecialObject(MetabaseSpecialObject.SharedParams).Edit As ISharedParams;
// Get global variable
GlobalVar := SParams.Params.FindById("GLOBAL_INT");
Debug.WriteLine("Variable value before change = " + GlobalVar.DefaultValue);
// Change global variable value
GlobalVar.DefaultValue := 35;
Debug.WriteLine("Variable value after change = " + GlobalVar.DefaultValue);
// Create a new global variable
GlobalVar := SParams.Params.Add;
GlobalVar.Name := "Prefix";
GlobalVar.Id := "GLOBAL_STR";
GlobalVar.DefaultValue := "ABC";
GlobalVar.DataType := DbDataType.String;
// Save changes
(SParams As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the default value is changed for the GLOBAL_INT global variable, and the new GLOBAL_STR global variable is created.
See also: