procedure TForm4.Button1Click(Sender: TObject);
begin try
if trim(ComboBox1.Text)='' then begin
MessageBox(0,'To save this note you needs to specify name of the note !',PChar(Application.Title),MB_OK+MB_ICONHAND);
ComboBox1.SetFocus;
exit;
end;
if ComboBox1.Items.IndexOf(trim(ComboBox1.Text))>0 then begin
MessageBox(0,PChar('Specified name "'+Trim(ComboBox1.Text)+'" is already exists in your notes collection. Please specify the different name'),PChar(Application.Title),MB_OK+MB_ICONHAND);
ComboBox1.SetFocus;
exit;
end;
Editor.Lines.SaveToFile(IncludeTrailingBackslash(form1.get_prj_info(form1.Label1.Caption).path_)+'My Notes\'+trim(ComboBox1.Text)+'.wrn');
CLose;
except end;End; |