SaveModuleToFile(Module: IModule; FileName: String);
Module is a repository unit that should be saved to the file.
FileName is a path and name of the file, in which the unit is saved.
The SaveModuleToFile method saves a unit into the specified file.
The "ppmodule" extension should be specified for a file, in which the unit is saved.
Executing the example requires that the repository contains a unit with the Module_1 identifier.
Sub UserProc;
Var
MB: IMetabase;
Fs: IForeSerializer;
MObj: IMetabaseObjectDescriptor;
Module: IModule;
Begin
MB := MetabaseClass.Active;
Fs := New ForeSerializer.Create;
MObj := MB.ItemById("Module_1");
Module := MObj.Bind As IModule;
Fs.SaveModuleToFile(Module, "c:\" + MObj.Id + ".ppmodule");
End Sub UserProc;
After executing the example the specified unit is saved to the file in the disk C root.
See also: