IsShared: Boolean;
The IsShared property determines a characteristic of the global object.
If the property is set to True, the object is considered an area of the global variables (MetabaseSpecialObject.SharedParams), if not, the object is not considered an area of the global variables. This property can be set to True for one repository object only, that is why when the property is set to True, it will be automatically set to False for the previous area.
By default the property is set to False.
Sub UserProc;
Var
MB : IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
Des: IMetabaseObjectDescriptor;
Obj: IMetabaseObject;
Shp: ISharedParams;
Params: IMetabaseObjectParams;
Pa: IMetabaseObjectParam;
Begin
MB := MetabaseClass.Active;
Mb.SpecialObject(MetabaseSpecialObject.SharedParams) := Null;
//create a global variables area
CrInfo := Mb.CreateCreateInfo;
CrInfo.Id := "MyParam";
CrInfo.Name := "MyParam";
CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_SHAREDPARAMS;
CrInfo.Parent := MB.ItemById("Folder");
CrInfo.Permanent := False;
Des := Mb.CreateObject(CrInfo);
Obj := Des.Edit;
Shp := Obj As ISharedParams;
Shp.IsShared := True;
Params := Shp.Params;
//create a parameter
Pa := Params.Add;
Pa.Id := "GLOBAL_INT";
Pa.DataType := DbDataType.Integer;
Pa.DefaultValue := 15;
Obj.Save;
End Sub UserProc;
Area of the global parameters and one global variable are created after executing this example.
See also: