Цитата:
Сообщение от Fer123
Что значит "структурированный код" объясни плз.
|
это значит что вместо такого:
delphi Код:
function ConvertNeeded(tmpstr : string) : boolean;
var i,countru,counteng:integer;
begin
countru:=0;
counteng:=0;
for i:=1 to length(tmpstr) do
begin
if tmpstr[i] in ['а'..'я','А'..'Я'] then inc(countru);
if tmpstr[i] in ['a'..'z','A'..'Z'] then inc(counteng);
end;
result:=true;
if (countru>0) and (counteng>=0) then result:=false;
end;
пишут так:
delphi Код:
function ConvertNeeded(tmpstr: string): boolean;
var
i, countru, counteng: integer;
begin
countru:=0;
counteng:=0;
for i:=1 to length(tmpstr) do begin
if tmpstr[i] in ['а'..'я','А'..'Я'] then inc(countru);
if tmpstr[i] in ['a'..'z','A'..'Z'] then inc(counteng);
end;
result:=true;
if (countru>0) and (counteng>=0) then result:=false;
end;