it1.Text ='') or (Edit2.Text ='') or (Memo1.Text ='')
then showmessage ('Не введені обов'язкові параметри! ')
else if (MaskEdit3.Text = '-') and (MaskEdit2.Text = '(8)') then
showmessage ('Введіть хоча б один номер телефону! ') else
begin fiozam: = Edit1.Text; fiozak: = Edit2.Text;
adres: = Memo1.Text; domtel: = MaskEdit3.Text;
sottel: = MaskEdit2.Text; data: = datetostr (DateTimePicker1.Date);
got: = memo4.Text; Form7.Showmodal; end; end;
procedure TForm1.N20Click (Sender: TObject);
begin form5.Showmodal; end;
procedure TForm1.FormCreate (Sender: TObject);
var f: textfile; s: string;
begin CheckEvent: = TEvent.Create (nil, false, true, 'MYPROGRAM_CHECKEXIST');
if CheckEvent.WaitFor (10) <> wrSignaled then
begin Showmessage ('Програма вже запущена!');
Self.Close; halt; end;
DateTimePicker1.Date: = Date; odn: ='';
dir: = ExtractFilePath (Application.ExeName);
AssignFile (f, dir + ' nzak.txt');
Reset (f); Read (f, s); nzak: = StrToInt (s); CloseFile (f); end;
function Search_And_Replace (RichEdit: TRichEdit;
SearchText, ReplaceText: string): Boolean;
var startpos, Position, endpos: integer;
begin startpos: = 0;
with RichEdit do begin endpos: = Length (RichEdit.Text);
Lines.BeginUpdate;
while FindText (SearchText, startpos, endpos, [stMatchCase]) <> -1 do
begin endpos: = Length (RichEdit.Text) - startpos;
Position: = FindText (SearchText, startpos, endpos, [stMatchCase]);
Inc (startpos, Length (SearchText)); SetFocus; SelStart: = Position;
SelLength: = Length (SearchText); richedit.clearselection;
SelText: = ReplaceText; end;
Lines.EndUpdate; end; end;
procedure TForm1.SpeedButton13Click (Sender: TObject);
Var b, a: string; begin
if (Fiozam ='') or (fiozak ='') or (adres ='')
then showmessage ('Не введені обов'язкові параметри! ') else
if prof ='' then Showmessage ('Введіть інформацію про замовлення! ') else
begin RichEdit1.Lines.LoadFromFile (dir + ' Звіти ЕвроДом.rtf');
Search_And_Replace (Richedit1, '№ 1', prof);
Search_And_Replace (Richedit1, '№ 2', spak);
Search_And_Replace (Richedit1, '№ 4', mon);
Search_And_Replace (Richedit1, '№ 3', got);
if (SOB ='') and (Lam ='') and (So9 ='') then b: =''
else if (SOB ='') or (Lam ='') or (So9 ='') then begin
if SOB ='' then b: = Lam + ';' + So9 + '; '+ Ton;
if Lam ='' then b: = SOB + ';' + So9 + '; '+ Ton;
if So9 ='' then b: = SOB + ';' + Lam + '; '+ Ton;
if (Lam ='') and (So9 ='') then b: = SOB + '; '+ Ton end
else b: = SOB + ';' + Lam + ';' + So9 + '; '+ Ton;
Search_And_Replace (Richedit1, '# B', b);
a: = MarkP + '(' + RazPod + ')' + Podsen + 'у.о';
if a = '() у.о' then a: ='';
Search_And_Replace (Richedit1, '# A', a ); p> if sottel = '(8)' then
Search_And_Replace (Richedit1, '# 6', ' ') p> else
Search_And_Replace (Richedit1, '# 6', sottel);
Search_And_Replace (Richedit1, '# C', itog);
Search_And_Replace (Richedit1, '# 5', domtel);
Search_And_Replace (Richedit1, '# 1', fiozam);
Search_And_Replace (Richedit1, '# 2', data);
Search_And_Replace (Richedit1, '# 3', fiozak);
Search_And_Replace (Richedit1, '# 4', adres);
end; end;
procedure TForm1.SpeedButton9Click (Sender: TObject);
begin
RichEdit1.Perform (EM_UNDO, 0, 0); end;
procedure TForm1.Edit1KeyPress (Sender: TObject; var Key: Char);
var// цифрова маска
vrLength, vrSelStart: byte;
begin
with Sender as TEdit do begin
vrLength: = Length (Text);// Визначаємо довжину тексту
vrSelStart: = SelStart;// визначаємо положення курсору
end;
case Key of 'А' .. 'Я': begin end;
'а' .. 'я': begin end;
# 8: begin end;
# 32: begin end;
# 46:
else
Key: = # 0;// "погасити" все решта клавіш
end; end;
procedure TForm1.Edit2KeyPress (Sender: TObject; var Key: Char);
var// цифрова маска
vrLength, vrSelStart: byte;
begin
with Sender as TEdit do
beg...