Здравствуйте, HAN-BRATAN, Вы писали:
Да, код, конечно, отнстойный, но его можно хорошо рефакторить.
Тут дело в плохом выравнивании.
Я провел рефакторинг, сделал нормальное выравнивание и код
теперь стал вполне читаемым (см. ниже):
CanContinue := False; if edCaptionUK.Text <> '' then
begin if edCaptionRU.Text = '' then begin
MessageBox(Handle,PChar('Ïîëå "' +
edCaptionRU.LabelCaption + '" ïîâè'
+'ííî ì'+'àòè ç'
'+íà÷åííÿ!'),PChar(
Application.Title), MB_OK or MB_ICONWARNING);
PageControl1.ActivePageIndex := 1; edCaptionRU.SetFocus;
Exit; end; if edCaptionEN.Text = '' then begin MessageBox(
Handle, PChar('Ïîëå "' +
edCaptionEN.LabelCaption + '" ïîâèí'
+'íî ìàòè çíà'
+'÷åííÿ!'), PChar(Application.Title),
MB_OK or MB_ICONWARNING);PageControl1.ActivePageIndex := 2;
edCaptionEN.SetFocus; Exit; end; end; if edCaptionRU.Text
<> '' then begin if edCaptionUK.Text = '' then begin
MessageBox(Handle, PChar('Ïîëå "'+
edCaptionUK.LabelCaption + '" ïîâèí'
+'íî ìàòè çíà'
+'÷åííÿ!'), PChar(Application.Title),
MB_OK or MB_ICONWARNING);PageControl1.ActivePageIndex := 0;
edCaptionUK.SetFocus;Exit;end;if edCaptionEN.Text = ''
then beginMessageBox(Handle, PChar('Ïîëå "'
+ edCaptionEN.LabelCaption + '" ïîâ'+
'èííî ìàòè '
+'çíà÷åííÿ!'),
PChar(Application.Title), MB_OK or MB_ICONWARNING);
PageControl1.ActivePageIndex := 2;edCaptionEN.SetFocus;
Exit;end;end;if edCaptionEN.Text <> '' then begin if
edCaptionUK.Text = '' then begin MessageBox(Handle,
PChar('Ïîëå "' + edCaptionUK.LabelCaption+
'" ïîâèííî ìà'
+'òè çíà÷åíí'
+'ÿ!'),PChar(Application.Title),MB_OK or MB_ICONWARNING);
PageControl1.ActivePageIndex := 0;edCaptionUK.SetFocus;Exit;end;
if edCaptionRU.Text = '' then begin MessageBox(Handle, PChar(
'Ïîëå "' + edCaptionRU.LabelCaption +
'" ïîâèííî ìà'
+'òè çíà÷åíí'
+'ÿ!'),PChar(Application.Title), MB_OK or
MB_ICONWARNING);PageControl1.ActivePageIndex := 1;
edCaptionRU.SetFocus;Exit;end;end;if edAuthorUK.Text
<> '' then begin if edAuthorRU.Text = '' then begin
MessageBox(Handle, PChar('Ïîëå "' +
edAuthorRU.LabelCaption + '" ïîâèí'
+'íî ìàòè çíà'
+'÷åííÿ!'),PChar(Application.Title),
MB_OK or MB_ICONWARNING);PageControl1.ActivePageIndex := 1;
edAuthorRU.SetFocus;Exit;end;if edAuthorEN.Text = ''
then begin MessageBox(Handle,PChar('Ïîë'
+'å "' + edAuthorEN.LabelCaption + '" ïî'
+'âèííî ìàòè '
+'çíà÷åííÿ!'),
PChar(Application.Title), MB_OK or MB_ICONWARNING);
PageControl1.ActivePageIndex := 2;edAuthorEN.SetFocus;
Exit;end;end;if edAuthorRU.Text <> '' then begin if
edAuthorUK.Text = '' then begin MessageBox(Handle,
PChar('Ïîëå "' + edAuthorUK.LabelCaption
+ '" ïîâèííî ìà'
+'òè çíà÷åí'
+'íÿ!'),PChar(Application.Title), MB_OK or
MB_ICONWARNING);PageControl1.ActivePageIndex := 0;
edAuthorUK.SetFocus;exit;end;if edAuthorEN.Text = ''
then begin MessageBox(Handle, PChar('Ïîë'
+'å "' + edAuthorEN.LabelCaption+'" ïî'
+'âèííî ìàò'
+'è çíà÷åíí'
+'ÿ!'),PChar(Application.Title), MB_OK or
MB_ICONWARNING);PageControl1.ActivePageIndex := 2;
edAuthorEN.SetFocus;Exit;end;end;if edAuthorEN.Text <> ''
then begin if edAuthorUK.Text = '' then begin MessageBox(
Handle, PChar('Ïîëå "' +
и т.д.
... << RSDN@Home 1.1.4 @@subversion >>