
02.06.2012, 01:09
|
Прохожий
|
|
Регистрация: 31.05.2012
Сообщения: 7
Репутация: 10
|
|
ну что, поможет кто?
вот код мой
Код:
I:=0;
found :=false;
while (i< memo1.Lines.Count) and (not found) do
begin
j:=1;
while (memo1.Lines[i][j]<>'0') and (j<length(memo1.Lines[i])) and (not found) do
begin
if trystrtoint(memo1.lines[i][j],p) then found:=true;
if not found then inc(j);
end;
if not found then inc(i);
end;
v:='';
l:=0;
if found then
begin
v:=copy(memo1.Lines[i],j,3);
if TryStrToInt(v,p) then l:=l+strtoint(v);
v:=copy(memo1.Lines[i],j+4,2);
if TryStrToInt(v,p) then l:=l+strtoint(v);
v:=copy(memo1.Lines[i],j+7,2);
if TryStrToInt(v,p) then l:=l+strtoint(v);
v:=copy(memo1.Lines[i],j+10,2);
p:=0;
TryStrToInt(v,p);
if (round((l)/5*10)-5)<>p then
Memo1.Lines[i]:=Memo1.Lines[i]+'ОШИБКА ВВОДА';
end;
|