KeepEdit: Boolean;
KeepEdit: boolean;
The KeepEdit property determines whether the object is in the edit state after creation.
If the property is set to True, after the executing the IMetabase.CreateObject method the created object will be in the edit mode. It enables adjusting the created object to the necessary interface and to set specific properties. If the property is set to False, the object should be opened in edit mode using the IMetabaseObjectDescriptor.Edit method to change specific properties of the created object.
Add a link to the Metabase system assembly.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
m: IModule;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_MODULE;
CrInfo.Parent := MB.Root;
CrInfo.KeepEdit := True;
m := MB.CreateObject(CrInfo) As IModule;
m.Text := "Sub Main;" + #13 + #10 +
"Begin" + #13 + #10 +
"End Sub Main;";
(m As IMetabaseObject).Save;
End Sub UserProc;
Public Sub Main(Params: StartParams);
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
m: IModule;
Begin
MB := Params.Metabase;
CrInfo := MB.CreateCreateInfo();
CrInfo.ClassId := MetabaseObjectClass.KE_CLASS_MODULE As Int32;
CrInfo.Parent := MB.Root;
CrInfo.KeepEdit := True;
m := MB.CreateObject(CrInfo) As IModule;
m.Text := "Sub Main;" + Char.ConvertFromUtf32(13) + Char.ConvertFromUtf32(10) +
"Begin" + Char.ConvertFromUtf32(13) + Char.ConvertFromUtf32(10) +
"End Sub Main;";
(m As IMetabaseObject).Save();
End Sub;
A new module is created in the repository root after executing this example. To specify the Main procedure in the module the structure remains open for editing after executing the I Metabase.CreateObject method.
See also: