{Если пусто то ничего не делать}
if sWord='' then begin
exit;
end;
{Проверка на выход слова из поля}
if WordDirHor then begin
if SCol+Length(sWord)-1 > fm_Main.sg.ColCount then begin
MessageDlg(_M_LgOut, mtError, [mbOk], 0);
end
end
else
if SRow+Length(sWord)-1 > fm_Main.sg.RowCount then begin
MessageDlg(_M_LgOut, mtError, [mbOk], 0);
end;
for i:=1 to length(sWord) do
if sWord[i]='*' then begin
// MessageDlg('Поставьте вместо звездочки желаемую букву.', mtInformantion, [
mbOk], 0);
fm_Word.ActiveControl := fm_Word.edWord;
fm_Word.edWord.SelStart := i-1;
fm_Word.edWord.SelLength := 1;
EMessage := '*';
Result := false;
exit;
end;
{ Проверка прохождения первого слова через середину поля ----------------------}
if GameState=gsJustStarted then begin
HaveCross := false;
for i:=1 to length(sWord) do
if FieldNextCell(i).Color=5 then
HaveCross := true;
if not HaveCross then begin
EMessage := _M_LgCenter;
Result := false;
exit;
end;
end;
{Проверка необходимого пересечения слов и сохранение позиций пересечения}
for i:=1 to MaxWordLength do
WordCross[i]:=false;
HaveCross := false;
if GameState=gsGame then begin
for i:=1 to Length(sWord) do
if FieldNextCell(i).Letter<>' ' then begin
WordCross[i] := true;
HaveCross := true;
end;
if not HaveCross then begin
EMessage := _M_LgNoCross;
Result := false;
exit;
end;
end;
{not JustStarted}
//
else
// GameState := gsGame;
{Проверка на наличие хотя бы одного FALSE в списке пересечений
(Проверка наличие хотя бы одной потраченой буквы)}
HaveCross := false;
for i:=1 to Length(sWord) do
if not WordCross[i] then
HaveCross := true;
if not HaveCross then begin
EMessage := _M_LgNoL2Set;
fm_Word.ActiveControl := fm_Word.edWord;
Result := false;
exit;
end;
(*
{Проверка отсутствия интервалов в списке пересечений = Проверка вложения слов}
nest := false;
for i:=1 to Length(Word) do
if WordCross[i] then begin
{A}
if nest then begin
EMessage := 'Проверка вложения слов: '+inttostr(i);
Result := false;
exit;
end
else
nest := true
end {A}
else
nest := false;
*)
{Проверка букв на принадлежность полученным буквам}
s := '';
for i:=1 to 7 do
s:=s + Players[PCurrent].Letters[i];
for i:=1 to Length(sWord) do begin
if not WordCross[i] then
if Pos(sWord[i],s)<>0 then
Delete(s,Pos(sWord[i],s),1)
else if Pos('*',s)<>0 then
Delete(s,Pos('*',s),1)
else begin
EMessage := Format(_M_mLNot,[sWord[i]]);
Result := false;
exit;
end;
end;
{for}