Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
если удалось определить пол по фамилии то в следующее поле «Имя» подгружаются исключительно мужские имена
procedure GetSex;
var
fmo, Familia, Imya, Otch, ImyaOtch, EndOtch, EndName, EndFam: string;
FirstSpace, SecondSpace: integer;
begin
fmo:=FIO.Text;
FirstSpace:=pos(' ',fmo);
if FirstSpace=0 then
begin
Familia:=fmo;
Imya:='';
Otch:='';
end
else
begin
Familia:=copy(fmo,0,firstspace);
ImyaOtch:=copy(fmo,firstspace+1,length(fmo));
imyaotch:=Trim(imyaotch);
SecondSpace:=pos(' ',imyaotch);
if secondspace=0 then
begin
Imya:=imyaotch;
otch:='';
end
else
begin
Imya:=copy(imyaotch,0,secondspace-1);
otch:=copy(imyaotch,secondspace+1,length(imyaotch));
end;
end;
if length(otch)>=1 then
EndOtch:=otch[length(otch)];
if length(imya)>=1 then
EndName:=imya[length(imya)];
if length(familia)>=1 then
EndFam:=Familia[length(Familia)];
if (EndOtch='а') or (Imya='Любовь') or (Imya='Нинель')
or
(
((EndOtch='') or (EndOtch='.') or (length(otch)=1))
and
((EndName='а') or (EndName='я'))
)
or
(
((EndName='') or (EndName='.') or (length(Imya)=1))
and
((EndFam='а') or (EndFam='я'))
16:35
)
then Female.Checked:=true else Male.Checked:=true;
end;
* This source code was highlighted with Source Code Highlighter.
Описание работы блока ФИО