LoadFromFileNF(FileName: String; [Mode: UpdateLoadMode = 0]);
LoadFromFileNF(FileName: System.String; Prognoz.Platform.Interop.Metabase.UpdateLoadMode);
FileName. Full name of the update file.
Mode. Method of loading objects into the update. Optional parameter.
The LoadFromFileNF method loads an update from a file with the *.pef extension.
The *.pefx format enables to save bigger number of objects to the update, comparing with the *.pef format. Use the IMetabaseUpdate.LoadFromFile method to load an update from the old *.pef format.
To execute the example, add a link to the Metabase system assembly. The C:\Update_1.pefx update file is required.
Sub UserProc;
Var
MB: IMetabase;
Update: IMetabaseUpdate;
SpecialObjNode: IMetabaseUpdateSpecialObjectsNode;
Begin
MB := MetabaseClass.Active;
Update := Mb.CreateUpdate;
Update.LoadFromFileNF("C:\Update_1.pefx");
SpecialObjNode := Update.SpecialObjectsNode;
SpecialObjNode.ApplyObject(MetabaseSpecialObject.SharedParams) := True;
Update.SaveToFileNF("C:\Update_2.pefx");
End Sub UserProc;
After executing the example a special object - global variables - is added to the update, loaded from the C:\Update_1.pefx file. Then the update is saved in other file.
The C:\Update_1.pefx update file is required. The specified procedure is an entry point for the .NET assembly.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Update: IMetabaseUpdate;
SpecialObjNode: IMetabaseUpdateSpecialObjectsNode;
Begin
MB := Params.Metabase;
Update := Mb.CreateUpdate();
Update.LoadFromFileNF("C:\"+ "Update_1.pefx", UpdateLoadMode.ulmReplace);
SpecialObjNode := Update.SpecialObjectsNode;
SpecialObjNode.ApplyObject[MetabaseSpecialObject.msoSharedParams] := True;
Update.SaveToFileNF("C:\" + "Update_2.pefx");
End Sub;
After executing the example a special object - global variables - is added to the update, loaded from the C:\Update_1.pefx file. Then the update is saved in other file.
See also: