create new empty code librarian file after click File>New:
procedure TSnippetsMainFrm.actFileNewAccept(Sender : TObject);
begin
if not actFileNew.Dialog.Execute then
exit;
if not FileExistsUTF8(actFileNew.Dialog.FileName) then
begin
if MessageDlg('File not exists', 'File '+actFileNew.Dialog.FileName+' not exists. Are you sure you want to create code library file?',
mtConfirmation, mbYesNo, 0)=mrNo then
exit;
FCodeLib:=CreateStorage;
end
else if not IsStructuredStorage(actFileNew.Dialog.FileName) then
begin
if MessageDlg('Selected file is not code library file', 'File '+actFileNew.Dialog.FileName+' is not code library file. Are you sure you want to replace this file with new code library file?',
mtConfirmation, mbYesNo, 0)=mrNo then
exit;
FCodeLib:=CreateStorage;
end;
FCodeLib.Initialize(actFileNew.Dialog.FileName, fmCreate);
LoadCodeLib;
end;